diff options
| author | Ingo Molnar <mingo@elte.hu> | 2009-02-17 19:09:07 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2009-02-17 19:09:07 -0500 |
| commit | ac07bcaa8259841905ead3f8cd60b1923ca6c0e5 (patch) | |
| tree | 162def1cd53ef477adca17fe06c33a484f6b2e87 /kernel | |
| parent | 37bd824a35a60abc73e5fa8816bd5f50c913d69b (diff) | |
| parent | 35ebf1caa4854ad5ba25f3a72967acc064147994 (diff) | |
Merge branch 'tip/tracing/ftrace' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into tracing/ftrace
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/trace/ftrace.c | 102 | ||||
| -rw-r--r-- | kernel/trace/trace.c | 2 | ||||
| -rw-r--r-- | kernel/trace/trace_functions.c | 31 | ||||
| -rw-r--r-- | kernel/trace/trace_irqsoff.c | 2 | ||||
| -rw-r--r-- | kernel/trace/trace_sched_switch.c | 2 | ||||
| -rw-r--r-- | kernel/trace/trace_sched_wakeup.c | 2 | ||||
| -rw-r--r-- | kernel/trace/trace_selftest.c | 16 | ||||
| -rw-r--r-- | kernel/trace/trace_stat.c | 2 | ||||
| -rw-r--r-- | kernel/trace/trace_sysprof.c | 2 |
9 files changed, 87 insertions, 74 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index aee95aea57e4..7dd5a2bef9cd 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
| @@ -255,9 +255,9 @@ static struct pid * const ftrace_swapper_pid = &init_struct_pid; | |||
| 255 | 255 | ||
| 256 | static struct hlist_head ftrace_func_hash[FTRACE_FUNC_HASHSIZE] __read_mostly; | 256 | static struct hlist_head ftrace_func_hash[FTRACE_FUNC_HASHSIZE] __read_mostly; |
| 257 | 257 | ||
| 258 | struct ftrace_func_hook { | 258 | struct ftrace_func_probe { |
| 259 | struct hlist_node node; | 259 | struct hlist_node node; |
| 260 | struct ftrace_hook_ops *ops; | 260 | struct ftrace_probe_ops *ops; |
| 261 | unsigned long flags; | 261 | unsigned long flags; |
| 262 | unsigned long ip; | 262 | unsigned long ip; |
| 263 | void *data; | 263 | void *data; |
| @@ -460,8 +460,8 @@ static void ftrace_bug(int failed, unsigned long ip) | |||
| 460 | static int | 460 | static int |
| 461 | __ftrace_replace_code(struct dyn_ftrace *rec, int enable) | 461 | __ftrace_replace_code(struct dyn_ftrace *rec, int enable) |
| 462 | { | 462 | { |
| 463 | unsigned long ip, fl; | ||
| 464 | unsigned long ftrace_addr; | 463 | unsigned long ftrace_addr; |
| 464 | unsigned long ip, fl; | ||
| 465 | 465 | ||
| 466 | ftrace_addr = (unsigned long)FTRACE_ADDR; | 466 | ftrace_addr = (unsigned long)FTRACE_ADDR; |
| 467 | 467 | ||
| @@ -530,9 +530,9 @@ __ftrace_replace_code(struct dyn_ftrace *rec, int enable) | |||
| 530 | 530 | ||
| 531 | static void ftrace_replace_code(int enable) | 531 | static void ftrace_replace_code(int enable) |
| 532 | { | 532 | { |
| 533 | int failed; | ||
| 534 | struct dyn_ftrace *rec; | 533 | struct dyn_ftrace *rec; |
| 535 | struct ftrace_page *pg; | 534 | struct ftrace_page *pg; |
| 535 | int failed; | ||
| 536 | 536 | ||
| 537 | do_for_each_ftrace_rec(pg, rec) { | 537 | do_for_each_ftrace_rec(pg, rec) { |
| 538 | /* | 538 | /* |
| @@ -830,11 +830,11 @@ static void *t_hash_start(struct seq_file *m, loff_t *pos) | |||
| 830 | 830 | ||
| 831 | static int t_hash_show(struct seq_file *m, void *v) | 831 | static int t_hash_show(struct seq_file *m, void *v) |
| 832 | { | 832 | { |
| 833 | struct ftrace_func_hook *rec; | 833 | struct ftrace_func_probe *rec; |
| 834 | struct hlist_node *hnd = v; | 834 | struct hlist_node *hnd = v; |
| 835 | char str[KSYM_SYMBOL_LEN]; | 835 | char str[KSYM_SYMBOL_LEN]; |
| 836 | 836 | ||
| 837 | rec = hlist_entry(hnd, struct ftrace_func_hook, node); | 837 | rec = hlist_entry(hnd, struct ftrace_func_probe, node); |
| 838 | 838 | ||
| 839 | if (rec->ops->print) | 839 | if (rec->ops->print) |
| 840 | return rec->ops->print(m, rec->ip, rec->ops, rec->data); | 840 | return rec->ops->print(m, rec->ip, rec->ops, rec->data); |
| @@ -1208,14 +1208,15 @@ ftrace_match_record(struct dyn_ftrace *rec, char *regex, int len, int type) | |||
| 1208 | 1208 | ||
| 1209 | static void ftrace_match_records(char *buff, int len, int enable) | 1209 | static void ftrace_match_records(char *buff, int len, int enable) |
| 1210 | { | 1210 | { |
| 1211 | char *search; | 1211 | unsigned int search_len; |
| 1212 | struct ftrace_page *pg; | 1212 | struct ftrace_page *pg; |
| 1213 | struct dyn_ftrace *rec; | 1213 | struct dyn_ftrace *rec; |
| 1214 | unsigned long flag; | ||
| 1215 | char *search; | ||
| 1214 | int type; | 1216 | int type; |
| 1215 | unsigned long flag = enable ? FTRACE_FL_FILTER : FTRACE_FL_NOTRACE; | ||
| 1216 | unsigned search_len; | ||
| 1217 | int not; | 1217 | int not; |
| 1218 | 1218 | ||
| 1219 | flag = enable ? FTRACE_FL_FILTER : FTRACE_FL_NOTRACE; | ||
| 1219 | type = ftrace_setup_glob(buff, len, &search, ¬); | 1220 | type = ftrace_setup_glob(buff, len, &search, ¬); |
| 1220 | 1221 | ||
| 1221 | search_len = strlen(search); | 1222 | search_len = strlen(search); |
| @@ -1263,14 +1264,16 @@ ftrace_match_module_record(struct dyn_ftrace *rec, char *mod, | |||
| 1263 | 1264 | ||
| 1264 | static void ftrace_match_module_records(char *buff, char *mod, int enable) | 1265 | static void ftrace_match_module_records(char *buff, char *mod, int enable) |
| 1265 | { | 1266 | { |
| 1266 | char *search = buff; | 1267 | unsigned search_len = 0; |
| 1267 | struct ftrace_page *pg; | 1268 | struct ftrace_page *pg; |
| 1268 | struct dyn_ftrace *rec; | 1269 | struct dyn_ftrace *rec; |
| 1269 | int type = MATCH_FULL; | 1270 | int type = MATCH_FULL; |
| 1270 | unsigned long flag = enable ? FTRACE_FL_FILTER : FTRACE_FL_NOTRACE; | 1271 | char *search = buff; |
| 1271 | unsigned search_len = 0; | 1272 | unsigned long flag; |
| 1272 | int not = 0; | 1273 | int not = 0; |
| 1273 | 1274 | ||
| 1275 | flag = enable ? FTRACE_FL_FILTER : FTRACE_FL_NOTRACE; | ||
| 1276 | |||
| 1274 | /* blank or '*' mean the same */ | 1277 | /* blank or '*' mean the same */ |
| 1275 | if (strcmp(buff, "*") == 0) | 1278 | if (strcmp(buff, "*") == 0) |
| 1276 | buff[0] = 0; | 1279 | buff[0] = 0; |
| @@ -1348,9 +1351,9 @@ static int __init ftrace_mod_cmd_init(void) | |||
| 1348 | device_initcall(ftrace_mod_cmd_init); | 1351 | device_initcall(ftrace_mod_cmd_init); |
| 1349 | 1352 | ||
| 1350 | static void | 1353 | static void |
| 1351 | function_trace_hook_call(unsigned long ip, unsigned long parent_ip) | 1354 | function_trace_probe_call(unsigned long ip, unsigned long parent_ip) |
| 1352 | { | 1355 | { |
| 1353 | struct ftrace_func_hook *entry; | 1356 | struct ftrace_func_probe *entry; |
| 1354 | struct hlist_head *hhd; | 1357 | struct hlist_head *hhd; |
| 1355 | struct hlist_node *n; | 1358 | struct hlist_node *n; |
| 1356 | unsigned long key; | 1359 | unsigned long key; |
| @@ -1376,18 +1379,18 @@ function_trace_hook_call(unsigned long ip, unsigned long parent_ip) | |||
| 1376 | ftrace_preempt_enable(resched); | 1379 | ftrace_preempt_enable(resched); |
| 1377 | } | 1380 | } |
| 1378 | 1381 | ||
| 1379 | static struct ftrace_ops trace_hook_ops __read_mostly = | 1382 | static struct ftrace_ops trace_probe_ops __read_mostly = |
| 1380 | { | 1383 | { |
| 1381 | .func = function_trace_hook_call, | 1384 | .func = function_trace_probe_call, |
| 1382 | }; | 1385 | }; |
| 1383 | 1386 | ||
| 1384 | static int ftrace_hook_registered; | 1387 | static int ftrace_probe_registered; |
| 1385 | 1388 | ||
| 1386 | static void __enable_ftrace_function_hook(void) | 1389 | static void __enable_ftrace_function_probe(void) |
| 1387 | { | 1390 | { |
| 1388 | int i; | 1391 | int i; |
| 1389 | 1392 | ||
| 1390 | if (ftrace_hook_registered) | 1393 | if (ftrace_probe_registered) |
| 1391 | return; | 1394 | return; |
| 1392 | 1395 | ||
| 1393 | for (i = 0; i < FTRACE_FUNC_HASHSIZE; i++) { | 1396 | for (i = 0; i < FTRACE_FUNC_HASHSIZE; i++) { |
| @@ -1399,16 +1402,16 @@ static void __enable_ftrace_function_hook(void) | |||
| 1399 | if (i == FTRACE_FUNC_HASHSIZE) | 1402 | if (i == FTRACE_FUNC_HASHSIZE) |
| 1400 | return; | 1403 | return; |
| 1401 | 1404 | ||
| 1402 | __register_ftrace_function(&trace_hook_ops); | 1405 | __register_ftrace_function(&trace_probe_ops); |
| 1403 | ftrace_startup(0); | 1406 | ftrace_startup(0); |
| 1404 | ftrace_hook_registered = 1; | 1407 | ftrace_probe_registered = 1; |
| 1405 | } | 1408 | } |
| 1406 | 1409 | ||
| 1407 | static void __disable_ftrace_function_hook(void) | 1410 | static void __disable_ftrace_function_probe(void) |
| 1408 | { | 1411 | { |
| 1409 | int i; | 1412 | int i; |
| 1410 | 1413 | ||
| 1411 | if (!ftrace_hook_registered) | 1414 | if (!ftrace_probe_registered) |
| 1412 | return; | 1415 | return; |
| 1413 | 1416 | ||
| 1414 | for (i = 0; i < FTRACE_FUNC_HASHSIZE; i++) { | 1417 | for (i = 0; i < FTRACE_FUNC_HASHSIZE; i++) { |
| @@ -1418,16 +1421,16 @@ static void __disable_ftrace_function_hook(void) | |||
| 1418 | } | 1421 | } |
| 1419 | 1422 | ||
| 1420 | /* no more funcs left */ | 1423 | /* no more funcs left */ |
| 1421 | __unregister_ftrace_function(&trace_hook_ops); | 1424 | __unregister_ftrace_function(&trace_probe_ops); |
| 1422 | ftrace_shutdown(0); | 1425 | ftrace_shutdown(0); |
| 1423 | ftrace_hook_registered = 0; | 1426 | ftrace_probe_registered = 0; |
| 1424 | } | 1427 | } |
| 1425 | 1428 | ||
| 1426 | 1429 | ||
| 1427 | static void ftrace_free_entry_rcu(struct rcu_head *rhp) | 1430 | static void ftrace_free_entry_rcu(struct rcu_head *rhp) |
| 1428 | { | 1431 | { |
| 1429 | struct ftrace_func_hook *entry = | 1432 | struct ftrace_func_probe *entry = |
| 1430 | container_of(rhp, struct ftrace_func_hook, rcu); | 1433 | container_of(rhp, struct ftrace_func_probe, rcu); |
| 1431 | 1434 | ||
| 1432 | if (entry->ops->free) | 1435 | if (entry->ops->free) |
| 1433 | entry->ops->free(&entry->data); | 1436 | entry->ops->free(&entry->data); |
| @@ -1436,21 +1439,21 @@ static void ftrace_free_entry_rcu(struct rcu_head *rhp) | |||
| 1436 | 1439 | ||
| 1437 | 1440 | ||
| 1438 | int | 1441 | int |
| 1439 | register_ftrace_function_hook(char *glob, struct ftrace_hook_ops *ops, | 1442 | register_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops, |
| 1440 | void *data) | 1443 | void *data) |
| 1441 | { | 1444 | { |
| 1442 | struct ftrace_func_hook *entry; | 1445 | struct ftrace_func_probe *entry; |
| 1443 | struct ftrace_page *pg; | 1446 | struct ftrace_page *pg; |
| 1444 | struct dyn_ftrace *rec; | 1447 | struct dyn_ftrace *rec; |
| 1445 | unsigned long key; | ||
| 1446 | int type, len, not; | 1448 | int type, len, not; |
| 1449 | unsigned long key; | ||
| 1447 | int count = 0; | 1450 | int count = 0; |
| 1448 | char *search; | 1451 | char *search; |
| 1449 | 1452 | ||
| 1450 | type = ftrace_setup_glob(glob, strlen(glob), &search, ¬); | 1453 | type = ftrace_setup_glob(glob, strlen(glob), &search, ¬); |
| 1451 | len = strlen(search); | 1454 | len = strlen(search); |
| 1452 | 1455 | ||
| 1453 | /* we do not support '!' for function hooks */ | 1456 | /* we do not support '!' for function probes */ |
| 1454 | if (WARN_ON(not)) | 1457 | if (WARN_ON(not)) |
| 1455 | return -EINVAL; | 1458 | return -EINVAL; |
| 1456 | 1459 | ||
| @@ -1465,7 +1468,7 @@ register_ftrace_function_hook(char *glob, struct ftrace_hook_ops *ops, | |||
| 1465 | 1468 | ||
| 1466 | entry = kmalloc(sizeof(*entry), GFP_KERNEL); | 1469 | entry = kmalloc(sizeof(*entry), GFP_KERNEL); |
| 1467 | if (!entry) { | 1470 | if (!entry) { |
| 1468 | /* If we did not hook to any, then return error */ | 1471 | /* If we did not process any, then return error */ |
| 1469 | if (!count) | 1472 | if (!count) |
| 1470 | count = -ENOMEM; | 1473 | count = -ENOMEM; |
| 1471 | goto out_unlock; | 1474 | goto out_unlock; |
| @@ -1495,7 +1498,7 @@ register_ftrace_function_hook(char *glob, struct ftrace_hook_ops *ops, | |||
| 1495 | hlist_add_head_rcu(&entry->node, &ftrace_func_hash[key]); | 1498 | hlist_add_head_rcu(&entry->node, &ftrace_func_hash[key]); |
| 1496 | 1499 | ||
| 1497 | } while_for_each_ftrace_rec(); | 1500 | } while_for_each_ftrace_rec(); |
| 1498 | __enable_ftrace_function_hook(); | 1501 | __enable_ftrace_function_probe(); |
| 1499 | 1502 | ||
| 1500 | out_unlock: | 1503 | out_unlock: |
| 1501 | mutex_unlock(&ftrace_lock); | 1504 | mutex_unlock(&ftrace_lock); |
| @@ -1504,15 +1507,15 @@ register_ftrace_function_hook(char *glob, struct ftrace_hook_ops *ops, | |||
| 1504 | } | 1507 | } |
| 1505 | 1508 | ||
| 1506 | enum { | 1509 | enum { |
| 1507 | HOOK_TEST_FUNC = 1, | 1510 | PROBE_TEST_FUNC = 1, |
| 1508 | HOOK_TEST_DATA = 2 | 1511 | PROBE_TEST_DATA = 2 |
| 1509 | }; | 1512 | }; |
| 1510 | 1513 | ||
| 1511 | static void | 1514 | static void |
| 1512 | __unregister_ftrace_function_hook(char *glob, struct ftrace_hook_ops *ops, | 1515 | __unregister_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops, |
| 1513 | void *data, int flags) | 1516 | void *data, int flags) |
| 1514 | { | 1517 | { |
| 1515 | struct ftrace_func_hook *entry; | 1518 | struct ftrace_func_probe *entry; |
| 1516 | struct hlist_node *n, *tmp; | 1519 | struct hlist_node *n, *tmp; |
| 1517 | char str[KSYM_SYMBOL_LEN]; | 1520 | char str[KSYM_SYMBOL_LEN]; |
| 1518 | int type = MATCH_FULL; | 1521 | int type = MATCH_FULL; |
| @@ -1527,7 +1530,7 @@ __unregister_ftrace_function_hook(char *glob, struct ftrace_hook_ops *ops, | |||
| 1527 | type = ftrace_setup_glob(glob, strlen(glob), &search, ¬); | 1530 | type = ftrace_setup_glob(glob, strlen(glob), &search, ¬); |
| 1528 | len = strlen(search); | 1531 | len = strlen(search); |
| 1529 | 1532 | ||
| 1530 | /* we do not support '!' for function hooks */ | 1533 | /* we do not support '!' for function probes */ |
| 1531 | if (WARN_ON(not)) | 1534 | if (WARN_ON(not)) |
| 1532 | return; | 1535 | return; |
| 1533 | } | 1536 | } |
| @@ -1539,10 +1542,10 @@ __unregister_ftrace_function_hook(char *glob, struct ftrace_hook_ops *ops, | |||
| 1539 | hlist_for_each_entry_safe(entry, n, tmp, hhd, node) { | 1542 | hlist_for_each_entry_safe(entry, n, tmp, hhd, node) { |
| 1540 | 1543 | ||
| 1541 | /* break up if statements for readability */ | 1544 | /* break up if statements for readability */ |
| 1542 | if ((flags & HOOK_TEST_FUNC) && entry->ops != ops) | 1545 | if ((flags & PROBE_TEST_FUNC) && entry->ops != ops) |
| 1543 | continue; | 1546 | continue; |
| 1544 | 1547 | ||
| 1545 | if ((flags & HOOK_TEST_DATA) && entry->data != data) | 1548 | if ((flags & PROBE_TEST_DATA) && entry->data != data) |
| 1546 | continue; | 1549 | continue; |
| 1547 | 1550 | ||
| 1548 | /* do this last, since it is the most expensive */ | 1551 | /* do this last, since it is the most expensive */ |
| @@ -1557,27 +1560,27 @@ __unregister_ftrace_function_hook(char *glob, struct ftrace_hook_ops *ops, | |||
| 1557 | call_rcu(&entry->rcu, ftrace_free_entry_rcu); | 1560 | call_rcu(&entry->rcu, ftrace_free_entry_rcu); |
| 1558 | } | 1561 | } |
| 1559 | } | 1562 | } |
| 1560 | __disable_ftrace_function_hook(); | 1563 | __disable_ftrace_function_probe(); |
| 1561 | mutex_unlock(&ftrace_lock); | 1564 | mutex_unlock(&ftrace_lock); |
| 1562 | } | 1565 | } |
| 1563 | 1566 | ||
| 1564 | void | 1567 | void |
| 1565 | unregister_ftrace_function_hook(char *glob, struct ftrace_hook_ops *ops, | 1568 | unregister_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops, |
| 1566 | void *data) | 1569 | void *data) |
| 1567 | { | 1570 | { |
| 1568 | __unregister_ftrace_function_hook(glob, ops, data, | 1571 | __unregister_ftrace_function_probe(glob, ops, data, |
| 1569 | HOOK_TEST_FUNC | HOOK_TEST_DATA); | 1572 | PROBE_TEST_FUNC | PROBE_TEST_DATA); |
| 1570 | } | 1573 | } |
| 1571 | 1574 | ||
| 1572 | void | 1575 | void |
| 1573 | unregister_ftrace_function_hook_func(char *glob, struct ftrace_hook_ops *ops) | 1576 | unregister_ftrace_function_probe_func(char *glob, struct ftrace_probe_ops *ops) |
| 1574 | { | 1577 | { |
| 1575 | __unregister_ftrace_function_hook(glob, ops, NULL, HOOK_TEST_FUNC); | 1578 | __unregister_ftrace_function_probe(glob, ops, NULL, PROBE_TEST_FUNC); |
| 1576 | } | 1579 | } |
| 1577 | 1580 | ||
| 1578 | void unregister_ftrace_function_hook_all(char *glob) | 1581 | void unregister_ftrace_function_probe_all(char *glob) |
| 1579 | { | 1582 | { |
| 1580 | __unregister_ftrace_function_hook(glob, NULL, NULL, 0); | 1583 | __unregister_ftrace_function_probe(glob, NULL, NULL, 0); |
| 1581 | } | 1584 | } |
| 1582 | 1585 | ||
| 1583 | static LIST_HEAD(ftrace_commands); | 1586 | static LIST_HEAD(ftrace_commands); |
| @@ -1623,8 +1626,8 @@ int unregister_ftrace_command(struct ftrace_func_command *cmd) | |||
| 1623 | 1626 | ||
| 1624 | static int ftrace_process_regex(char *buff, int len, int enable) | 1627 | static int ftrace_process_regex(char *buff, int len, int enable) |
| 1625 | { | 1628 | { |
| 1626 | struct ftrace_func_command *p; | ||
| 1627 | char *func, *command, *next = buff; | 1629 | char *func, *command, *next = buff; |
| 1630 | struct ftrace_func_command *p; | ||
| 1628 | int ret = -EINVAL; | 1631 | int ret = -EINVAL; |
| 1629 | 1632 | ||
| 1630 | func = strsep(&next, ":"); | 1633 | func = strsep(&next, ":"); |
| @@ -2392,7 +2395,6 @@ static __init int ftrace_init_debugfs(void) | |||
| 2392 | "'set_ftrace_pid' entry\n"); | 2395 | "'set_ftrace_pid' entry\n"); |
| 2393 | return 0; | 2396 | return 0; |
| 2394 | } | 2397 | } |
| 2395 | |||
| 2396 | fs_initcall(ftrace_init_debugfs); | 2398 | fs_initcall(ftrace_init_debugfs); |
| 2397 | 2399 | ||
| 2398 | /** | 2400 | /** |
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 95f99a7abf2f..dc61e82faad9 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
| @@ -336,7 +336,7 @@ __update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu) | |||
| 336 | data->rt_priority = tsk->rt_priority; | 336 | data->rt_priority = tsk->rt_priority; |
| 337 | 337 | ||
| 338 | /* record this tasks comm */ | 338 | /* record this tasks comm */ |
| 339 | tracing_record_cmdline(current); | 339 | tracing_record_cmdline(tsk); |
| 340 | } | 340 | } |
| 341 | 341 | ||
| 342 | static void | 342 | static void |
diff --git a/kernel/trace/trace_functions.c b/kernel/trace/trace_functions.c index f520aa419dff..4c113a8c466f 100644 --- a/kernel/trace/trace_functions.c +++ b/kernel/trace/trace_functions.c | |||
| @@ -269,21 +269,21 @@ ftrace_traceoff(unsigned long ip, unsigned long parent_ip, void **data) | |||
| 269 | 269 | ||
| 270 | static int | 270 | static int |
| 271 | ftrace_trace_onoff_print(struct seq_file *m, unsigned long ip, | 271 | ftrace_trace_onoff_print(struct seq_file *m, unsigned long ip, |
| 272 | struct ftrace_hook_ops *ops, void *data); | 272 | struct ftrace_probe_ops *ops, void *data); |
| 273 | 273 | ||
| 274 | static struct ftrace_hook_ops traceon_hook_ops = { | 274 | static struct ftrace_probe_ops traceon_probe_ops = { |
| 275 | .func = ftrace_traceon, | 275 | .func = ftrace_traceon, |
| 276 | .print = ftrace_trace_onoff_print, | 276 | .print = ftrace_trace_onoff_print, |
| 277 | }; | 277 | }; |
| 278 | 278 | ||
| 279 | static struct ftrace_hook_ops traceoff_hook_ops = { | 279 | static struct ftrace_probe_ops traceoff_probe_ops = { |
| 280 | .func = ftrace_traceoff, | 280 | .func = ftrace_traceoff, |
| 281 | .print = ftrace_trace_onoff_print, | 281 | .print = ftrace_trace_onoff_print, |
| 282 | }; | 282 | }; |
| 283 | 283 | ||
| 284 | static int | 284 | static int |
| 285 | ftrace_trace_onoff_print(struct seq_file *m, unsigned long ip, | 285 | ftrace_trace_onoff_print(struct seq_file *m, unsigned long ip, |
| 286 | struct ftrace_hook_ops *ops, void *data) | 286 | struct ftrace_probe_ops *ops, void *data) |
| 287 | { | 287 | { |
| 288 | char str[KSYM_SYMBOL_LEN]; | 288 | char str[KSYM_SYMBOL_LEN]; |
| 289 | long count = (long)data; | 289 | long count = (long)data; |
| @@ -291,12 +291,14 @@ ftrace_trace_onoff_print(struct seq_file *m, unsigned long ip, | |||
| 291 | kallsyms_lookup(ip, NULL, NULL, NULL, str); | 291 | kallsyms_lookup(ip, NULL, NULL, NULL, str); |
| 292 | seq_printf(m, "%s:", str); | 292 | seq_printf(m, "%s:", str); |
| 293 | 293 | ||
| 294 | if (ops == &traceon_hook_ops) | 294 | if (ops == &traceon_probe_ops) |
| 295 | seq_printf(m, "traceon"); | 295 | seq_printf(m, "traceon"); |
| 296 | else | 296 | else |
| 297 | seq_printf(m, "traceoff"); | 297 | seq_printf(m, "traceoff"); |
| 298 | 298 | ||
| 299 | if (count != -1) | 299 | if (count == -1) |
| 300 | seq_printf(m, ":unlimited\n"); | ||
| 301 | else | ||
| 300 | seq_printf(m, ":count=%ld", count); | 302 | seq_printf(m, ":count=%ld", count); |
| 301 | seq_putc(m, '\n'); | 303 | seq_putc(m, '\n'); |
| 302 | 304 | ||
| @@ -306,15 +308,15 @@ ftrace_trace_onoff_print(struct seq_file *m, unsigned long ip, | |||
| 306 | static int | 308 | static int |
| 307 | ftrace_trace_onoff_unreg(char *glob, char *cmd, char *param) | 309 | ftrace_trace_onoff_unreg(char *glob, char *cmd, char *param) |
| 308 | { | 310 | { |
| 309 | struct ftrace_hook_ops *ops; | 311 | struct ftrace_probe_ops *ops; |
| 310 | 312 | ||
| 311 | /* we register both traceon and traceoff to this callback */ | 313 | /* we register both traceon and traceoff to this callback */ |
| 312 | if (strcmp(cmd, "traceon") == 0) | 314 | if (strcmp(cmd, "traceon") == 0) |
| 313 | ops = &traceon_hook_ops; | 315 | ops = &traceon_probe_ops; |
| 314 | else | 316 | else |
| 315 | ops = &traceoff_hook_ops; | 317 | ops = &traceoff_probe_ops; |
| 316 | 318 | ||
| 317 | unregister_ftrace_function_hook_func(glob, ops); | 319 | unregister_ftrace_function_probe_func(glob, ops); |
| 318 | 320 | ||
| 319 | return 0; | 321 | return 0; |
| 320 | } | 322 | } |
| @@ -322,7 +324,7 @@ ftrace_trace_onoff_unreg(char *glob, char *cmd, char *param) | |||
| 322 | static int | 324 | static int |
| 323 | ftrace_trace_onoff_callback(char *glob, char *cmd, char *param, int enable) | 325 | ftrace_trace_onoff_callback(char *glob, char *cmd, char *param, int enable) |
| 324 | { | 326 | { |
| 325 | struct ftrace_hook_ops *ops; | 327 | struct ftrace_probe_ops *ops; |
| 326 | void *count = (void *)-1; | 328 | void *count = (void *)-1; |
| 327 | char *number; | 329 | char *number; |
| 328 | int ret; | 330 | int ret; |
| @@ -336,9 +338,9 @@ ftrace_trace_onoff_callback(char *glob, char *cmd, char *param, int enable) | |||
| 336 | 338 | ||
| 337 | /* we register both traceon and traceoff to this callback */ | 339 | /* we register both traceon and traceoff to this callback */ |
| 338 | if (strcmp(cmd, "traceon") == 0) | 340 | if (strcmp(cmd, "traceon") == 0) |
| 339 | ops = &traceon_hook_ops; | 341 | ops = &traceon_probe_ops; |
| 340 | else | 342 | else |
| 341 | ops = &traceoff_hook_ops; | 343 | ops = &traceoff_probe_ops; |
| 342 | 344 | ||
| 343 | if (!param) | 345 | if (!param) |
| 344 | goto out_reg; | 346 | goto out_reg; |
| @@ -357,7 +359,7 @@ ftrace_trace_onoff_callback(char *glob, char *cmd, char *param, int enable) | |||
| 357 | return ret; | 359 | return ret; |
| 358 | 360 | ||
| 359 | out_reg: | 361 | out_reg: |
| 360 | ret = register_ftrace_function_hook(glob, ops, count); | 362 | ret = register_ftrace_function_probe(glob, ops, count); |
| 361 | 363 | ||
| 362 | return ret; | 364 | return ret; |
| 363 | } | 365 | } |
| @@ -397,6 +399,5 @@ static __init int init_function_trace(void) | |||
| 397 | init_func_cmd_traceon(); | 399 | init_func_cmd_traceon(); |
| 398 | return register_tracer(&function_trace); | 400 | return register_tracer(&function_trace); |
| 399 | } | 401 | } |
| 400 | |||
| 401 | device_initcall(init_function_trace); | 402 | device_initcall(init_function_trace); |
| 402 | 403 | ||
diff --git a/kernel/trace/trace_irqsoff.c b/kernel/trace/trace_irqsoff.c index c6b442d88de8..9e5ebd844158 100644 --- a/kernel/trace/trace_irqsoff.c +++ b/kernel/trace/trace_irqsoff.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * trace irqs off criticall timings | 2 | * trace irqs off critical timings |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2007-2008 Steven Rostedt <srostedt@redhat.com> | 4 | * Copyright (C) 2007-2008 Steven Rostedt <srostedt@redhat.com> |
| 5 | * Copyright (C) 2008 Ingo Molnar <mingo@redhat.com> | 5 | * Copyright (C) 2008 Ingo Molnar <mingo@redhat.com> |
diff --git a/kernel/trace/trace_sched_switch.c b/kernel/trace/trace_sched_switch.c index 30e14fe85896..82fbb5a2df89 100644 --- a/kernel/trace/trace_sched_switch.c +++ b/kernel/trace/trace_sched_switch.c | |||
| @@ -93,7 +93,7 @@ static int tracing_sched_register(void) | |||
| 93 | ret = register_trace_sched_switch(probe_sched_switch); | 93 | ret = register_trace_sched_switch(probe_sched_switch); |
| 94 | if (ret) { | 94 | if (ret) { |
| 95 | pr_info("sched trace: Couldn't activate tracepoint" | 95 | pr_info("sched trace: Couldn't activate tracepoint" |
| 96 | " probe to kernel_sched_schedule\n"); | 96 | " probe to kernel_sched_switch\n"); |
| 97 | goto fail_deprobe_wake_new; | 97 | goto fail_deprobe_wake_new; |
| 98 | } | 98 | } |
| 99 | 99 | ||
diff --git a/kernel/trace/trace_sched_wakeup.c b/kernel/trace/trace_sched_wakeup.c index 96d716485898..276c51aaf314 100644 --- a/kernel/trace/trace_sched_wakeup.c +++ b/kernel/trace/trace_sched_wakeup.c | |||
| @@ -284,7 +284,7 @@ static void start_wakeup_tracer(struct trace_array *tr) | |||
| 284 | ret = register_trace_sched_switch(probe_wakeup_sched_switch); | 284 | ret = register_trace_sched_switch(probe_wakeup_sched_switch); |
| 285 | if (ret) { | 285 | if (ret) { |
| 286 | pr_info("sched trace: Couldn't activate tracepoint" | 286 | pr_info("sched trace: Couldn't activate tracepoint" |
| 287 | " probe to kernel_sched_schedule\n"); | 287 | " probe to kernel_sched_switch\n"); |
| 288 | goto fail_deprobe_wake_new; | 288 | goto fail_deprobe_wake_new; |
| 289 | } | 289 | } |
| 290 | 290 | ||
diff --git a/kernel/trace/trace_selftest.c b/kernel/trace/trace_selftest.c index 0c9aa1457e51..01415f4edaa5 100644 --- a/kernel/trace/trace_selftest.c +++ b/kernel/trace/trace_selftest.c | |||
| @@ -107,9 +107,9 @@ int trace_selftest_startup_dynamic_tracing(struct tracer *trace, | |||
| 107 | func(); | 107 | func(); |
| 108 | 108 | ||
| 109 | /* | 109 | /* |
| 110 | * Some archs *cough*PowerPC*cough* add charachters to the | 110 | * Some archs *cough*PowerPC*cough* add characters to the |
| 111 | * start of the function names. We simply put a '*' to | 111 | * start of the function names. We simply put a '*' to |
| 112 | * accomodate them. | 112 | * accommodate them. |
| 113 | */ | 113 | */ |
| 114 | func_name = "*" STR(DYN_FTRACE_TEST_NAME); | 114 | func_name = "*" STR(DYN_FTRACE_TEST_NAME); |
| 115 | 115 | ||
| @@ -622,7 +622,7 @@ trace_selftest_startup_sysprof(struct tracer *trace, struct trace_array *tr) | |||
| 622 | ret = tracer_init(trace, tr); | 622 | ret = tracer_init(trace, tr); |
| 623 | if (ret) { | 623 | if (ret) { |
| 624 | warn_failed_init_tracer(trace, ret); | 624 | warn_failed_init_tracer(trace, ret); |
| 625 | return 0; | 625 | return ret; |
| 626 | } | 626 | } |
| 627 | 627 | ||
| 628 | /* Sleep for a 1/10 of a second */ | 628 | /* Sleep for a 1/10 of a second */ |
| @@ -634,6 +634,11 @@ trace_selftest_startup_sysprof(struct tracer *trace, struct trace_array *tr) | |||
| 634 | trace->reset(tr); | 634 | trace->reset(tr); |
| 635 | tracing_start(); | 635 | tracing_start(); |
| 636 | 636 | ||
| 637 | if (!ret && !count) { | ||
| 638 | printk(KERN_CONT ".. no entries found .."); | ||
| 639 | ret = -1; | ||
| 640 | } | ||
| 641 | |||
| 637 | return ret; | 642 | return ret; |
| 638 | } | 643 | } |
| 639 | #endif /* CONFIG_SYSPROF_TRACER */ | 644 | #endif /* CONFIG_SYSPROF_TRACER */ |
| @@ -661,6 +666,11 @@ trace_selftest_startup_branch(struct tracer *trace, struct trace_array *tr) | |||
| 661 | trace->reset(tr); | 666 | trace->reset(tr); |
| 662 | tracing_start(); | 667 | tracing_start(); |
| 663 | 668 | ||
| 669 | if (!ret && !count) { | ||
| 670 | printk(KERN_CONT ".. no entries found .."); | ||
| 671 | ret = -1; | ||
| 672 | } | ||
| 673 | |||
| 664 | return ret; | 674 | return ret; |
| 665 | } | 675 | } |
| 666 | #endif /* CONFIG_BRANCH_TRACER */ | 676 | #endif /* CONFIG_BRANCH_TRACER */ |
diff --git a/kernel/trace/trace_stat.c b/kernel/trace/trace_stat.c index eae9cef39291..39310e3434ee 100644 --- a/kernel/trace/trace_stat.c +++ b/kernel/trace/trace_stat.c | |||
| @@ -30,7 +30,7 @@ struct tracer_stat_session { | |||
| 30 | struct dentry *file; | 30 | struct dentry *file; |
| 31 | }; | 31 | }; |
| 32 | 32 | ||
| 33 | /* All of the sessions currently in use. Each stat file embeed one session */ | 33 | /* All of the sessions currently in use. Each stat file embed one session */ |
| 34 | static LIST_HEAD(all_stat_sessions); | 34 | static LIST_HEAD(all_stat_sessions); |
| 35 | static DEFINE_MUTEX(all_stat_sessions_mutex); | 35 | static DEFINE_MUTEX(all_stat_sessions_mutex); |
| 36 | 36 | ||
diff --git a/kernel/trace/trace_sysprof.c b/kernel/trace/trace_sysprof.c index 7c9a2d82a7d8..c771af4e8f1a 100644 --- a/kernel/trace/trace_sysprof.c +++ b/kernel/trace/trace_sysprof.c | |||
| @@ -327,5 +327,5 @@ void init_tracer_sysprof_debugfs(struct dentry *d_tracer) | |||
| 327 | d_tracer, NULL, &sysprof_sample_fops); | 327 | d_tracer, NULL, &sysprof_sample_fops); |
| 328 | if (entry) | 328 | if (entry) |
| 329 | return; | 329 | return; |
| 330 | pr_warning("Could not create debugfs 'dyn_ftrace_total_info' entry\n"); | 330 | pr_warning("Could not create debugfs 'sysprof_sample_period' entry\n"); |
| 331 | } | 331 | } |
