trace_events.c (490b929d42d2a321887f9538a83fc9f215675f15) | trace_events.c (85f2b08268c014e290b600ba49fa85530600eaa1) |
---|---|
1/* 2 * event tracer 3 * 4 * Copyright (C) 2008 Red Hat Inc, Steven Rostedt <srostedt@redhat.com> 5 * 6 * - Added format output of fields of the trace point. 7 * This was based off of work by Tom Zanussi <tzanussi@gmail.com>. 8 * --- 328 unchanged lines hidden (view full) --- 337 call->flags |= TRACE_EVENT_FL_WAS_ENABLED; 338 } 339 break; 340 } 341 342 return ret; 343} 344 | 1/* 2 * event tracer 3 * 4 * Copyright (C) 2008 Red Hat Inc, Steven Rostedt <srostedt@redhat.com> 5 * 6 * - Added format output of fields of the trace point. 7 * This was based off of work by Tom Zanussi <tzanussi@gmail.com>. 8 * --- 328 unchanged lines hidden (view full) --- 337 call->flags |= TRACE_EVENT_FL_WAS_ENABLED; 338 } 339 break; 340 } 341 342 return ret; 343} 344 |
345int trace_event_enable_disable(struct ftrace_event_file *file, 346 int enable, int soft_disable) 347{ 348 return __ftrace_event_enable_disable(file, enable, soft_disable); 349} 350 |
|
345static int ftrace_event_enable_disable(struct ftrace_event_file *file, 346 int enable) 347{ 348 return __ftrace_event_enable_disable(file, enable, 0); 349} 350 351static void ftrace_clear_events(struct trace_array *tr) 352{ --- 63 unchanged lines hidden (view full) --- 416 417 if (!--dir->nr_events) { 418 debugfs_remove_recursive(dir->entry); 419 list_del(&dir->list); 420 __put_system_dir(dir); 421 } 422} 423 | 351static int ftrace_event_enable_disable(struct ftrace_event_file *file, 352 int enable) 353{ 354 return __ftrace_event_enable_disable(file, enable, 0); 355} 356 357static void ftrace_clear_events(struct trace_array *tr) 358{ --- 63 unchanged lines hidden (view full) --- 422 423 if (!--dir->nr_events) { 424 debugfs_remove_recursive(dir->entry); 425 list_del(&dir->list); 426 __put_system_dir(dir); 427 } 428} 429 |
424static void *event_file_data(struct file *filp) 425{ 426 return ACCESS_ONCE(file_inode(filp)->i_private); 427} 428 | |
429static void remove_event_file_dir(struct ftrace_event_file *file) 430{ 431 struct dentry *dir = file->dir; 432 struct dentry *child; 433 434 if (dir) { 435 spin_lock(&dir->d_lock); /* probably unneeded */ 436 list_for_each_entry(child, &dir->d_subdirs, d_u.d_child) { --- 1107 unchanged lines hidden (view full) --- 1544 pr_warning("Could not initialize trace point" 1545 " events/%s\n", call->name); 1546 return -1; 1547 } 1548 } 1549 trace_create_file("filter", 0644, file->dir, file, 1550 &ftrace_event_filter_fops); 1551 | 430static void remove_event_file_dir(struct ftrace_event_file *file) 431{ 432 struct dentry *dir = file->dir; 433 struct dentry *child; 434 435 if (dir) { 436 spin_lock(&dir->d_lock); /* probably unneeded */ 437 list_for_each_entry(child, &dir->d_subdirs, d_u.d_child) { --- 1107 unchanged lines hidden (view full) --- 1545 pr_warning("Could not initialize trace point" 1546 " events/%s\n", call->name); 1547 return -1; 1548 } 1549 } 1550 trace_create_file("filter", 0644, file->dir, file, 1551 &ftrace_event_filter_fops); 1552 |
1553 trace_create_file("trigger", 0644, file->dir, file, 1554 &event_trigger_fops); 1555 |
|
1552 trace_create_file("format", 0444, file->dir, call, 1553 &ftrace_event_format_fops); 1554 1555 return 0; 1556} 1557 1558static void remove_event_from_tracers(struct ftrace_event_call *call) 1559{ --- 80 unchanged lines hidden (view full) --- 1640 1641 file = kmem_cache_alloc(file_cachep, GFP_TRACE); 1642 if (!file) 1643 return NULL; 1644 1645 file->event_call = call; 1646 file->tr = tr; 1647 atomic_set(&file->sm_ref, 0); | 1556 trace_create_file("format", 0444, file->dir, call, 1557 &ftrace_event_format_fops); 1558 1559 return 0; 1560} 1561 1562static void remove_event_from_tracers(struct ftrace_event_call *call) 1563{ --- 80 unchanged lines hidden (view full) --- 1644 1645 file = kmem_cache_alloc(file_cachep, GFP_TRACE); 1646 if (!file) 1647 return NULL; 1648 1649 file->event_call = call; 1650 file->tr = tr; 1651 atomic_set(&file->sm_ref, 0); |
1652 atomic_set(&file->tm_ref, 0); 1653 INIT_LIST_HEAD(&file->triggers); |
|
1648 list_add(&file->list, &tr->events); 1649 1650 return file; 1651} 1652 1653/* Add an event to a trace directory */ 1654static int 1655__trace_add_new_event(struct ftrace_event_call *call, struct trace_array *tr) --- 650 unchanged lines hidden (view full) --- 2306 2307 return ret; 2308} 2309 2310int event_trace_del_tracer(struct trace_array *tr) 2311{ 2312 mutex_lock(&event_mutex); 2313 | 1654 list_add(&file->list, &tr->events); 1655 1656 return file; 1657} 1658 1659/* Add an event to a trace directory */ 1660static int 1661__trace_add_new_event(struct ftrace_event_call *call, struct trace_array *tr) --- 650 unchanged lines hidden (view full) --- 2312 2313 return ret; 2314} 2315 2316int event_trace_del_tracer(struct trace_array *tr) 2317{ 2318 mutex_lock(&event_mutex); 2319 |
2320 /* Disable any event triggers and associated soft-disabled events */ 2321 clear_event_triggers(tr); 2322 |
|
2314 /* Disable any running events */ 2315 __ftrace_set_clr_event_nolock(tr, NULL, NULL, NULL, 0); 2316 2317 /* Access to events are within rcu_read_lock_sched() */ 2318 synchronize_sched(); 2319 2320 down_write(&trace_event_sem); 2321 __trace_remove_event_dirs(tr); --- 50 unchanged lines hidden (view full) --- 2372 if (ret) 2373 pr_warn("Failed to enable trace event: %s\n", token); 2374 } 2375 2376 trace_printk_start_comm(); 2377 2378 register_event_cmds(); 2379 | 2323 /* Disable any running events */ 2324 __ftrace_set_clr_event_nolock(tr, NULL, NULL, NULL, 0); 2325 2326 /* Access to events are within rcu_read_lock_sched() */ 2327 synchronize_sched(); 2328 2329 down_write(&trace_event_sem); 2330 __trace_remove_event_dirs(tr); --- 50 unchanged lines hidden (view full) --- 2381 if (ret) 2382 pr_warn("Failed to enable trace event: %s\n", token); 2383 } 2384 2385 trace_printk_start_comm(); 2386 2387 register_event_cmds(); 2388 |
2389 register_trigger_cmds(); 2390 |
|
2380 return 0; 2381} 2382 2383static __init int event_trace_init(void) 2384{ 2385 struct trace_array *tr; 2386 struct dentry *d_tracer; 2387 struct dentry *entry; --- 273 unchanged lines hidden --- | 2391 return 0; 2392} 2393 2394static __init int event_trace_init(void) 2395{ 2396 struct trace_array *tr; 2397 struct dentry *d_tracer; 2398 struct dentry *entry; --- 273 unchanged lines hidden --- |