aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/traceevent/plugin_function.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-08-26 14:25:21 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-08-26 14:25:21 -0400
commitd207ea8e74ff45be0838afa12bdd2492fa9dc8bc (patch)
tree97cfb3ed5c1bb42790e98e62b823526f61000b9f /tools/lib/traceevent/plugin_function.c
parent2a8a2b7c49d6eb5f3348892c4676267376cfd40b (diff)
parent66e5db4a1ccc64f278653bc69dc406d184dc750a (diff)
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf updates from Thomas Gleixner: "Kernel: - Improve kallsyms coverage - Add x86 entry trampolines to kcore - Fix ARM SPE handling - Correct PPC event post processing Tools: - Make the build system more robust - Small fixes and enhancements all over the place - Update kernel ABI header copies - Preparatory work for converting libtraceevnt to a shared library - License cleanups" * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (100 commits) tools arch: Update arch/x86/lib/memcpy_64.S copy used in 'perf bench mem memcpy' tools arch x86: Update tools's copy of cpufeatures.h perf python: Fix pyrf_evlist__read_on_cpu() interface perf mmap: Store real cpu number in 'struct perf_mmap' perf tools: Remove ext from struct kmod_path perf tools: Add gzip_is_compressed function perf tools: Add lzma_is_compressed function perf tools: Add is_compressed callback to compressions array perf tools: Move the temp file processing into decompress_kmodule perf tools: Use compression id in decompress_kmodule() perf tools: Store compression id into struct dso perf tools: Add compression id into 'struct kmod_path' perf tools: Make is_supported_compression() static perf tools: Make decompress_to_file() function static perf tools: Get rid of dso__needs_decompress() call in __open_dso() perf tools: Get rid of dso__needs_decompress() call in symbol__disassemble() perf tools: Get rid of dso__needs_decompress() call in read_object_code() tools lib traceevent: Change to SPDX License format perf llvm: Allow passing options to llc in addition to clang perf parser: Improve error message for PMU address filters ...
Diffstat (limited to 'tools/lib/traceevent/plugin_function.c')
-rw-r--r--tools/lib/traceevent/plugin_function.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/tools/lib/traceevent/plugin_function.c b/tools/lib/traceevent/plugin_function.c
index 42dbf73758f3..424747475d37 100644
--- a/tools/lib/traceevent/plugin_function.c
+++ b/tools/lib/traceevent/plugin_function.c
@@ -33,7 +33,7 @@ static int cpus = -1;
33 33
34#define STK_BLK 10 34#define STK_BLK 10
35 35
36struct pevent_plugin_option plugin_options[] = 36struct tep_plugin_option plugin_options[] =
37{ 37{
38 { 38 {
39 .name = "parent", 39 .name = "parent",
@@ -53,8 +53,8 @@ struct pevent_plugin_option plugin_options[] =
53 } 53 }
54}; 54};
55 55
56static struct pevent_plugin_option *ftrace_parent = &plugin_options[0]; 56static struct tep_plugin_option *ftrace_parent = &plugin_options[0];
57static struct pevent_plugin_option *ftrace_indent = &plugin_options[1]; 57static struct tep_plugin_option *ftrace_indent = &plugin_options[1];
58 58
59static void add_child(struct func_stack *stack, const char *child, int pos) 59static void add_child(struct func_stack *stack, const char *child, int pos)
60{ 60{
@@ -122,25 +122,25 @@ static int add_and_get_index(const char *parent, const char *child, int cpu)
122 return 0; 122 return 0;
123} 123}
124 124
125static int function_handler(struct trace_seq *s, struct pevent_record *record, 125static int function_handler(struct trace_seq *s, struct tep_record *record,
126 struct event_format *event, void *context) 126 struct event_format *event, void *context)
127{ 127{
128 struct pevent *pevent = event->pevent; 128 struct tep_handle *pevent = event->pevent;
129 unsigned long long function; 129 unsigned long long function;
130 unsigned long long pfunction; 130 unsigned long long pfunction;
131 const char *func; 131 const char *func;
132 const char *parent; 132 const char *parent;
133 int index = 0; 133 int index = 0;
134 134
135 if (pevent_get_field_val(s, event, "ip", record, &function, 1)) 135 if (tep_get_field_val(s, event, "ip", record, &function, 1))
136 return trace_seq_putc(s, '!'); 136 return trace_seq_putc(s, '!');
137 137
138 func = pevent_find_function(pevent, function); 138 func = tep_find_function(pevent, function);
139 139
140 if (pevent_get_field_val(s, event, "parent_ip", record, &pfunction, 1)) 140 if (tep_get_field_val(s, event, "parent_ip", record, &pfunction, 1))
141 return trace_seq_putc(s, '!'); 141 return trace_seq_putc(s, '!');
142 142
143 parent = pevent_find_function(pevent, pfunction); 143 parent = tep_find_function(pevent, pfunction);
144 144
145 if (parent && ftrace_indent->set) 145 if (parent && ftrace_indent->set)
146 index = add_and_get_index(parent, func, record->cpu); 146 index = add_and_get_index(parent, func, record->cpu);
@@ -163,22 +163,22 @@ static int function_handler(struct trace_seq *s, struct pevent_record *record,
163 return 0; 163 return 0;
164} 164}
165 165
166int PEVENT_PLUGIN_LOADER(struct pevent *pevent) 166int TEP_PLUGIN_LOADER(struct tep_handle *pevent)
167{ 167{
168 pevent_register_event_handler(pevent, -1, "ftrace", "function", 168 tep_register_event_handler(pevent, -1, "ftrace", "function",
169 function_handler, NULL); 169 function_handler, NULL);
170 170
171 traceevent_plugin_add_options("ftrace", plugin_options); 171 tep_plugin_add_options("ftrace", plugin_options);
172 172
173 return 0; 173 return 0;
174} 174}
175 175
176void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent) 176void TEP_PLUGIN_UNLOADER(struct tep_handle *pevent)
177{ 177{
178 int i, x; 178 int i, x;
179 179
180 pevent_unregister_event_handler(pevent, -1, "ftrace", "function", 180 tep_unregister_event_handler(pevent, -1, "ftrace", "function",
181 function_handler, NULL); 181 function_handler, NULL);
182 182
183 for (i = 0; i <= cpus; i++) { 183 for (i = 0; i <= cpus; i++) {
184 for (x = 0; x < fstack[i].size && fstack[i].stack[x]; x++) 184 for (x = 0; x < fstack[i].size && fstack[i].stack[x]; x++)
@@ -186,7 +186,7 @@ void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent)
186 free(fstack[i].stack); 186 free(fstack[i].stack);
187 } 187 }
188 188
189 traceevent_plugin_remove_options(plugin_options); 189 tep_plugin_remove_options(plugin_options);
190 190
191 free(fstack); 191 free(fstack);
192 fstack = NULL; 192 fstack = NULL;