diff options
Diffstat (limited to 'kernel/trace')
| -rw-r--r-- | kernel/trace/trace.c | 2 | ||||
| -rw-r--r-- | kernel/trace/trace_events.c | 19 | ||||
| -rw-r--r-- | kernel/trace/trace_functions_graph.c | 8 | ||||
| -rw-r--r-- | kernel/trace/trace_output.c | 3 | ||||
| -rw-r--r-- | kernel/trace/trace_uprobe.c | 2 |
5 files changed, 26 insertions, 8 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 91eecaaa43e0..05330494a0df 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
| @@ -6079,7 +6079,7 @@ trace_create_cpu_file(const char *name, umode_t mode, struct dentry *parent, | |||
| 6079 | struct dentry *ret = trace_create_file(name, mode, parent, data, fops); | 6079 | struct dentry *ret = trace_create_file(name, mode, parent, data, fops); |
| 6080 | 6080 | ||
| 6081 | if (ret) /* See tracing_get_cpu() */ | 6081 | if (ret) /* See tracing_get_cpu() */ |
| 6082 | ret->d_inode->i_cdev = (void *)(cpu + 1); | 6082 | d_inode(ret)->i_cdev = (void *)(cpu + 1); |
| 6083 | return ret; | 6083 | return ret; |
| 6084 | } | 6084 | } |
| 6085 | 6085 | ||
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 7da1dfeb322e..c4de47fc5cca 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c | |||
| @@ -494,8 +494,8 @@ static void remove_event_file_dir(struct ftrace_event_file *file) | |||
| 494 | if (dir) { | 494 | if (dir) { |
| 495 | spin_lock(&dir->d_lock); /* probably unneeded */ | 495 | spin_lock(&dir->d_lock); /* probably unneeded */ |
| 496 | list_for_each_entry(child, &dir->d_subdirs, d_child) { | 496 | list_for_each_entry(child, &dir->d_subdirs, d_child) { |
| 497 | if (child->d_inode) /* probably unneeded */ | 497 | if (d_really_is_positive(child)) /* probably unneeded */ |
| 498 | child->d_inode->i_private = NULL; | 498 | d_inode(child)->i_private = NULL; |
| 499 | } | 499 | } |
| 500 | spin_unlock(&dir->d_lock); | 500 | spin_unlock(&dir->d_lock); |
| 501 | 501 | ||
| @@ -565,6 +565,7 @@ static int __ftrace_set_clr_event(struct trace_array *tr, const char *match, | |||
| 565 | static int ftrace_set_clr_event(struct trace_array *tr, char *buf, int set) | 565 | static int ftrace_set_clr_event(struct trace_array *tr, char *buf, int set) |
| 566 | { | 566 | { |
| 567 | char *event = NULL, *sub = NULL, *match; | 567 | char *event = NULL, *sub = NULL, *match; |
| 568 | int ret; | ||
| 568 | 569 | ||
| 569 | /* | 570 | /* |
| 570 | * The buf format can be <subsystem>:<event-name> | 571 | * The buf format can be <subsystem>:<event-name> |
| @@ -590,7 +591,13 @@ static int ftrace_set_clr_event(struct trace_array *tr, char *buf, int set) | |||
| 590 | event = NULL; | 591 | event = NULL; |
| 591 | } | 592 | } |
| 592 | 593 | ||
| 593 | return __ftrace_set_clr_event(tr, match, sub, event, set); | 594 | ret = __ftrace_set_clr_event(tr, match, sub, event, set); |
| 595 | |||
| 596 | /* Put back the colon to allow this to be called again */ | ||
| 597 | if (buf) | ||
| 598 | *(buf - 1) = ':'; | ||
| 599 | |||
| 600 | return ret; | ||
| 594 | } | 601 | } |
| 595 | 602 | ||
| 596 | /** | 603 | /** |
| @@ -1753,6 +1760,8 @@ static void update_event_printk(struct ftrace_event_call *call, | |||
| 1753 | ptr++; | 1760 | ptr++; |
| 1754 | /* Check for alpha chars like ULL */ | 1761 | /* Check for alpha chars like ULL */ |
| 1755 | } while (isalnum(*ptr)); | 1762 | } while (isalnum(*ptr)); |
| 1763 | if (!*ptr) | ||
| 1764 | break; | ||
| 1756 | /* | 1765 | /* |
| 1757 | * A number must have some kind of delimiter after | 1766 | * A number must have some kind of delimiter after |
| 1758 | * it, and we can ignore that too. | 1767 | * it, and we can ignore that too. |
| @@ -1779,12 +1788,16 @@ static void update_event_printk(struct ftrace_event_call *call, | |||
| 1779 | do { | 1788 | do { |
| 1780 | ptr++; | 1789 | ptr++; |
| 1781 | } while (isalnum(*ptr) || *ptr == '_'); | 1790 | } while (isalnum(*ptr) || *ptr == '_'); |
| 1791 | if (!*ptr) | ||
| 1792 | break; | ||
| 1782 | /* | 1793 | /* |
| 1783 | * If what comes after this variable is a '.' or | 1794 | * If what comes after this variable is a '.' or |
| 1784 | * '->' then we can continue to ignore that string. | 1795 | * '->' then we can continue to ignore that string. |
| 1785 | */ | 1796 | */ |
| 1786 | if (*ptr == '.' || (ptr[0] == '-' && ptr[1] == '>')) { | 1797 | if (*ptr == '.' || (ptr[0] == '-' && ptr[1] == '>')) { |
| 1787 | ptr += *ptr == '.' ? 1 : 2; | 1798 | ptr += *ptr == '.' ? 1 : 2; |
| 1799 | if (!*ptr) | ||
| 1800 | break; | ||
| 1788 | goto skip_more; | 1801 | goto skip_more; |
| 1789 | } | 1802 | } |
| 1790 | /* | 1803 | /* |
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c index 9cfea4c6d314..a51e79688455 100644 --- a/kernel/trace/trace_functions_graph.c +++ b/kernel/trace/trace_functions_graph.c | |||
| @@ -1308,15 +1308,19 @@ void graph_trace_open(struct trace_iterator *iter) | |||
| 1308 | { | 1308 | { |
| 1309 | /* pid and depth on the last trace processed */ | 1309 | /* pid and depth on the last trace processed */ |
| 1310 | struct fgraph_data *data; | 1310 | struct fgraph_data *data; |
| 1311 | gfp_t gfpflags; | ||
| 1311 | int cpu; | 1312 | int cpu; |
| 1312 | 1313 | ||
| 1313 | iter->private = NULL; | 1314 | iter->private = NULL; |
| 1314 | 1315 | ||
| 1315 | data = kzalloc(sizeof(*data), GFP_KERNEL); | 1316 | /* We can be called in atomic context via ftrace_dump() */ |
| 1317 | gfpflags = (in_atomic() || irqs_disabled()) ? GFP_ATOMIC : GFP_KERNEL; | ||
| 1318 | |||
| 1319 | data = kzalloc(sizeof(*data), gfpflags); | ||
| 1316 | if (!data) | 1320 | if (!data) |
| 1317 | goto out_err; | 1321 | goto out_err; |
| 1318 | 1322 | ||
| 1319 | data->cpu_data = alloc_percpu(struct fgraph_cpu_data); | 1323 | data->cpu_data = alloc_percpu_gfp(struct fgraph_cpu_data, gfpflags); |
| 1320 | if (!data->cpu_data) | 1324 | if (!data->cpu_data) |
| 1321 | goto out_err_free; | 1325 | goto out_err_free; |
| 1322 | 1326 | ||
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c index 692bf7184c8c..25a086bcb700 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c | |||
| @@ -178,12 +178,13 @@ ftrace_print_hex_seq(struct trace_seq *p, const unsigned char *buf, int buf_len) | |||
| 178 | EXPORT_SYMBOL(ftrace_print_hex_seq); | 178 | EXPORT_SYMBOL(ftrace_print_hex_seq); |
| 179 | 179 | ||
| 180 | const char * | 180 | const char * |
| 181 | ftrace_print_array_seq(struct trace_seq *p, const void *buf, int buf_len, | 181 | ftrace_print_array_seq(struct trace_seq *p, const void *buf, int count, |
| 182 | size_t el_size) | 182 | size_t el_size) |
| 183 | { | 183 | { |
| 184 | const char *ret = trace_seq_buffer_ptr(p); | 184 | const char *ret = trace_seq_buffer_ptr(p); |
| 185 | const char *prefix = ""; | 185 | const char *prefix = ""; |
| 186 | void *ptr = (void *)buf; | 186 | void *ptr = (void *)buf; |
| 187 | size_t buf_len = count * el_size; | ||
| 187 | 188 | ||
| 188 | trace_seq_putc(p, '{'); | 189 | trace_seq_putc(p, '{'); |
| 189 | 190 | ||
diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c index d60fe62ec4fa..6dd022c7b5bc 100644 --- a/kernel/trace/trace_uprobe.c +++ b/kernel/trace/trace_uprobe.c | |||
| @@ -443,7 +443,7 @@ static int create_trace_uprobe(int argc, char **argv) | |||
| 443 | if (ret) | 443 | if (ret) |
| 444 | goto fail_address_parse; | 444 | goto fail_address_parse; |
| 445 | 445 | ||
| 446 | inode = igrab(path.dentry->d_inode); | 446 | inode = igrab(d_inode(path.dentry)); |
| 447 | path_put(&path); | 447 | path_put(&path); |
| 448 | 448 | ||
| 449 | if (!inode || !S_ISREG(inode->i_mode)) { | 449 | if (!inode || !S_ISREG(inode->i_mode)) { |
