diff options
author | Masami Hiramatsu <mhiramat@redhat.com> | 2010-03-16 18:05:44 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-03-17 06:32:30 -0400 |
commit | 12a1fadb41b5a6733c36b488b881fb19a28c92d3 (patch) | |
tree | 4a7302b12ed4c89d1785920c00ed908930013491 /tools | |
parent | e0faa8d35845bb1893cf9e608a5a5d92e9390bf0 (diff) |
perf probe: Rename session to param
Since this name 'session' conflicts with 'perf_session', and
this structure just holds parameters anymore.
Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: systemtap <systemtap@sources.redhat.com>
Cc: DLE <dle-develop@lists.sourceforge.net>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20100316220544.32050.8788.stgit@localhost6.localdomain6>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/builtin-probe.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c index 2087034782ff..f577e1410362 100644 --- a/tools/perf/builtin-probe.c +++ b/tools/perf/builtin-probe.c | |||
@@ -56,20 +56,20 @@ static struct { | |||
56 | struct probe_point probes[MAX_PROBES]; | 56 | struct probe_point probes[MAX_PROBES]; |
57 | struct strlist *dellist; | 57 | struct strlist *dellist; |
58 | struct line_range line_range; | 58 | struct line_range line_range; |
59 | } session; | 59 | } params; |
60 | 60 | ||
61 | 61 | ||
62 | /* Parse an event definition. Note that any error must die. */ | 62 | /* Parse an event definition. Note that any error must die. */ |
63 | static void parse_probe_event(const char *str) | 63 | static void parse_probe_event(const char *str) |
64 | { | 64 | { |
65 | struct probe_point *pp = &session.probes[session.nr_probe]; | 65 | struct probe_point *pp = ¶ms.probes[params.nr_probe]; |
66 | 66 | ||
67 | pr_debug("probe-definition(%d): %s\n", session.nr_probe, str); | 67 | pr_debug("probe-definition(%d): %s\n", params.nr_probe, str); |
68 | if (++session.nr_probe == MAX_PROBES) | 68 | if (++params.nr_probe == MAX_PROBES) |
69 | die("Too many probes (> %d) are specified.", MAX_PROBES); | 69 | die("Too many probes (> %d) are specified.", MAX_PROBES); |
70 | 70 | ||
71 | /* Parse perf-probe event into probe_point */ | 71 | /* Parse perf-probe event into probe_point */ |
72 | parse_perf_probe_event(str, pp, &session.need_dwarf); | 72 | parse_perf_probe_event(str, pp, ¶ms.need_dwarf); |
73 | 73 | ||
74 | pr_debug("%d arguments\n", pp->nr_args); | 74 | pr_debug("%d arguments\n", pp->nr_args); |
75 | } | 75 | } |
@@ -103,9 +103,9 @@ static int opt_del_probe_event(const struct option *opt __used, | |||
103 | const char *str, int unset __used) | 103 | const char *str, int unset __used) |
104 | { | 104 | { |
105 | if (str) { | 105 | if (str) { |
106 | if (!session.dellist) | 106 | if (!params.dellist) |
107 | session.dellist = strlist__new(true, NULL); | 107 | params.dellist = strlist__new(true, NULL); |
108 | strlist__add(session.dellist, str); | 108 | strlist__add(params.dellist, str); |
109 | } | 109 | } |
110 | return 0; | 110 | return 0; |
111 | } | 111 | } |
@@ -115,9 +115,9 @@ static int opt_show_lines(const struct option *opt __used, | |||
115 | const char *str, int unset __used) | 115 | const char *str, int unset __used) |
116 | { | 116 | { |
117 | if (str) | 117 | if (str) |
118 | parse_line_range_desc(str, &session.line_range); | 118 | parse_line_range_desc(str, ¶ms.line_range); |
119 | INIT_LIST_HEAD(&session.line_range.line_list); | 119 | INIT_LIST_HEAD(¶ms.line_range.line_list); |
120 | session.show_lines = true; | 120 | params.show_lines = true; |
121 | return 0; | 121 | return 0; |
122 | } | 122 | } |
123 | #endif | 123 | #endif |
@@ -140,7 +140,7 @@ static const struct option options[] = { | |||
140 | OPT_STRING('k', "vmlinux", &symbol_conf.vmlinux_name, | 140 | OPT_STRING('k', "vmlinux", &symbol_conf.vmlinux_name, |
141 | "file", "vmlinux pathname"), | 141 | "file", "vmlinux pathname"), |
142 | #endif | 142 | #endif |
143 | OPT_BOOLEAN('l', "list", &session.list_events, | 143 | OPT_BOOLEAN('l', "list", ¶ms.list_events, |
144 | "list up current probe events"), | 144 | "list up current probe events"), |
145 | OPT_CALLBACK('d', "del", NULL, "[GROUP:]EVENT", "delete a probe event.", | 145 | OPT_CALLBACK('d', "del", NULL, "[GROUP:]EVENT", "delete a probe event.", |
146 | opt_del_probe_event), | 146 | opt_del_probe_event), |
@@ -168,7 +168,7 @@ static const struct option options[] = { | |||
168 | #endif | 168 | #endif |
169 | "\t\t\tkprobe-tracer argument format.)\n", | 169 | "\t\t\tkprobe-tracer argument format.)\n", |
170 | opt_add_probe_event), | 170 | opt_add_probe_event), |
171 | OPT_BOOLEAN('f', "force", &session.force_add, "forcibly add events" | 171 | OPT_BOOLEAN('f', "force", ¶ms.force_add, "forcibly add events" |
172 | " with existing name"), | 172 | " with existing name"), |
173 | #ifndef NO_DWARF_SUPPORT | 173 | #ifndef NO_DWARF_SUPPORT |
174 | OPT_CALLBACK('L', "line", NULL, | 174 | OPT_CALLBACK('L', "line", NULL, |
@@ -190,20 +190,20 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used) | |||
190 | parse_probe_event_argv(argc, argv); | 190 | parse_probe_event_argv(argc, argv); |
191 | } | 191 | } |
192 | 192 | ||
193 | if ((!session.nr_probe && !session.dellist && !session.list_events && | 193 | if ((!params.nr_probe && !params.dellist && !params.list_events && |
194 | !session.show_lines)) | 194 | !params.show_lines)) |
195 | usage_with_options(probe_usage, options); | 195 | usage_with_options(probe_usage, options); |
196 | 196 | ||
197 | if (debugfs_valid_mountpoint(debugfs_path) < 0) | 197 | if (debugfs_valid_mountpoint(debugfs_path) < 0) |
198 | die("Failed to find debugfs path."); | 198 | die("Failed to find debugfs path."); |
199 | 199 | ||
200 | if (session.list_events) { | 200 | if (params.list_events) { |
201 | if (session.nr_probe != 0 || session.dellist) { | 201 | if (params.nr_probe != 0 || params.dellist) { |
202 | pr_warning(" Error: Don't use --list with" | 202 | pr_warning(" Error: Don't use --list with" |
203 | " --add/--del.\n"); | 203 | " --add/--del.\n"); |
204 | usage_with_options(probe_usage, options); | 204 | usage_with_options(probe_usage, options); |
205 | } | 205 | } |
206 | if (session.show_lines) { | 206 | if (params.show_lines) { |
207 | pr_warning(" Error: Don't use --list with --line.\n"); | 207 | pr_warning(" Error: Don't use --list with --line.\n"); |
208 | usage_with_options(probe_usage, options); | 208 | usage_with_options(probe_usage, options); |
209 | } | 209 | } |
@@ -212,27 +212,27 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used) | |||
212 | } | 212 | } |
213 | 213 | ||
214 | #ifndef NO_DWARF_SUPPORT | 214 | #ifndef NO_DWARF_SUPPORT |
215 | if (session.show_lines) { | 215 | if (params.show_lines) { |
216 | if (session.nr_probe != 0 || session.dellist) { | 216 | if (params.nr_probe != 0 || params.dellist) { |
217 | pr_warning(" Error: Don't use --line with" | 217 | pr_warning(" Error: Don't use --line with" |
218 | " --add/--del.\n"); | 218 | " --add/--del.\n"); |
219 | usage_with_options(probe_usage, options); | 219 | usage_with_options(probe_usage, options); |
220 | } | 220 | } |
221 | 221 | ||
222 | show_line_range(&session.line_range); | 222 | show_line_range(¶ms.line_range); |
223 | return 0; | 223 | return 0; |
224 | } | 224 | } |
225 | #endif | 225 | #endif |
226 | 226 | ||
227 | if (session.dellist) { | 227 | if (params.dellist) { |
228 | del_trace_kprobe_events(session.dellist); | 228 | del_trace_kprobe_events(params.dellist); |
229 | strlist__delete(session.dellist); | 229 | strlist__delete(params.dellist); |
230 | if (session.nr_probe == 0) | 230 | if (params.nr_probe == 0) |
231 | return 0; | 231 | return 0; |
232 | } | 232 | } |
233 | 233 | ||
234 | add_trace_kprobe_events(session.probes, session.nr_probe, | 234 | add_trace_kprobe_events(params.probes, params.nr_probe, |
235 | session.force_add, session.need_dwarf); | 235 | params.force_add, params.need_dwarf); |
236 | return 0; | 236 | return 0; |
237 | } | 237 | } |
238 | 238 | ||