aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-probe.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-probe.c')
-rw-r--r--tools/perf/builtin-probe.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
index 5a47c1e11f77..559eeb42c5e7 100644
--- a/tools/perf/builtin-probe.c
+++ b/tools/perf/builtin-probe.c
@@ -59,13 +59,13 @@ const char *default_search_path[NR_SEARCH_PATH] = {
59static struct { 59static struct {
60 char *vmlinux; 60 char *vmlinux;
61 char *release; 61 char *release;
62 int need_dwarf; 62 bool need_dwarf;
63 bool list_events;
63 int nr_probe; 64 int nr_probe;
64 struct probe_point probes[MAX_PROBES]; 65 struct probe_point probes[MAX_PROBES];
65 struct strlist *dellist; 66 struct strlist *dellist;
66} session; 67} session;
67 68
68static bool listing;
69 69
70/* Parse an event definition. Note that any error must die. */ 70/* Parse an event definition. Note that any error must die. */
71static void parse_probe_event(const char *str) 71static void parse_probe_event(const char *str)
@@ -77,7 +77,7 @@ static void parse_probe_event(const char *str)
77 die("Too many probes (> %d) are specified.", MAX_PROBES); 77 die("Too many probes (> %d) are specified.", MAX_PROBES);
78 78
79 /* Parse perf-probe event into probe_point */ 79 /* Parse perf-probe event into probe_point */
80 session.need_dwarf = parse_perf_probe_event(str, pp); 80 parse_perf_probe_event(str, pp, &session.need_dwarf);
81 81
82 pr_debug("%d arguments\n", pp->nr_args); 82 pr_debug("%d arguments\n", pp->nr_args);
83} 83}
@@ -166,7 +166,8 @@ static const struct option options[] = {
166 OPT_STRING('k', "vmlinux", &session.vmlinux, "file", 166 OPT_STRING('k', "vmlinux", &session.vmlinux, "file",
167 "vmlinux/module pathname"), 167 "vmlinux/module pathname"),
168#endif 168#endif
169 OPT_BOOLEAN('l', "list", &listing, "list up current probe events"), 169 OPT_BOOLEAN('l', "list", &session.list_events,
170 "list up current probe events"),
170 OPT_CALLBACK('d', "del", NULL, "[GROUP:]EVENT", "delete a probe event.", 171 OPT_CALLBACK('d', "del", NULL, "[GROUP:]EVENT", "delete a probe event.",
171 opt_del_probe_event), 172 opt_del_probe_event),
172 OPT_CALLBACK('a', "add", NULL, 173 OPT_CALLBACK('a', "add", NULL,
@@ -207,10 +208,10 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used)
207 if (argc > 0) 208 if (argc > 0)
208 parse_probe_event_argv(argc, argv); 209 parse_probe_event_argv(argc, argv);
209 210
210 if ((session.nr_probe == 0 && !session.dellist && !listing)) 211 if ((!session.nr_probe && !session.dellist && !session.list_events))
211 usage_with_options(probe_usage, options); 212 usage_with_options(probe_usage, options);
212 213
213 if (listing) { 214 if (session.list_events) {
214 if (session.nr_probe != 0 || session.dellist) { 215 if (session.nr_probe != 0 || session.dellist) {
215 pr_warning(" Error: Don't use --list with" 216 pr_warning(" Error: Don't use --list with"
216 " --add/--del.\n"); 217 " --add/--del.\n");