builtin-probe.c (a1926d1745114789687ac029ae8c58944b7d2256) | builtin-probe.c (e80711ca8512c8586da0c3e18e2f1caf73c88731) |
---|---|
1/* 2 * builtin-probe.c 3 * 4 * Builtin probe command: Set up probe events by C expression 5 * 6 * Written by Masami Hiramatsu <mhiramat@redhat.com> 7 * 8 * This program is free software; you can redistribute it and/or modify --- 38 unchanged lines hidden (view full) --- 47 48/* Session management structure */ 49static struct { 50 bool list_events; 51 bool force_add; 52 bool show_lines; 53 bool show_vars; 54 bool show_ext_vars; | 1/* 2 * builtin-probe.c 3 * 4 * Builtin probe command: Set up probe events by C expression 5 * 6 * Written by Masami Hiramatsu <mhiramat@redhat.com> 7 * 8 * This program is free software; you can redistribute it and/or modify --- 38 unchanged lines hidden (view full) --- 47 48/* Session management structure */ 49static struct { 50 bool list_events; 51 bool force_add; 52 bool show_lines; 53 bool show_vars; 54 bool show_ext_vars; |
55 bool show_funcs; |
|
55 bool mod_events; 56 int nevents; 57 struct perf_probe_event events[MAX_PROBES]; 58 struct strlist *dellist; 59 struct line_range line_range; 60 const char *target_module; 61 int max_probe_points; 62} params; --- 153 unchanged lines hidden (view full) --- 216 OPT_STRING('s', "source", &symbol_conf.source_prefix, 217 "directory", "path to kernel source"), 218 OPT_STRING('m', "module", ¶ms.target_module, 219 "modname", "target module name"), 220#endif 221 OPT__DRY_RUN(&probe_event_dry_run), 222 OPT_INTEGER('\0', "max-probes", ¶ms.max_probe_points, 223 "Set how many probe points can be found for a probe."), | 56 bool mod_events; 57 int nevents; 58 struct perf_probe_event events[MAX_PROBES]; 59 struct strlist *dellist; 60 struct line_range line_range; 61 const char *target_module; 62 int max_probe_points; 63} params; --- 153 unchanged lines hidden (view full) --- 217 OPT_STRING('s', "source", &symbol_conf.source_prefix, 218 "directory", "path to kernel source"), 219 OPT_STRING('m', "module", ¶ms.target_module, 220 "modname", "target module name"), 221#endif 222 OPT__DRY_RUN(&probe_event_dry_run), 223 OPT_INTEGER('\0', "max-probes", ¶ms.max_probe_points, 224 "Set how many probe points can be found for a probe."), |
225 OPT_BOOLEAN('F', "funcs", ¶ms.show_funcs, 226 "Show potential probe-able functions."), |
|
224 OPT_END() 225}; 226 227int cmd_probe(int argc, const char **argv, const char *prefix __used) 228{ 229 int ret; 230 231 argc = parse_options(argc, argv, options, probe_usage, --- 9 unchanged lines hidden (view full) --- 241 return ret; 242 } 243 } 244 245 if (params.max_probe_points == 0) 246 params.max_probe_points = MAX_PROBES; 247 248 if ((!params.nevents && !params.dellist && !params.list_events && | 227 OPT_END() 228}; 229 230int cmd_probe(int argc, const char **argv, const char *prefix __used) 231{ 232 int ret; 233 234 argc = parse_options(argc, argv, options, probe_usage, --- 9 unchanged lines hidden (view full) --- 244 return ret; 245 } 246 } 247 248 if (params.max_probe_points == 0) 249 params.max_probe_points = MAX_PROBES; 250 251 if ((!params.nevents && !params.dellist && !params.list_events && |
249 !params.show_lines)) | 252 !params.show_lines && !params.show_funcs)) |
250 usage_with_options(probe_usage, options); 251 252 /* 253 * Only consider the user's kernel image path if given. 254 */ 255 symbol_conf.try_vmlinux_path = (symbol_conf.vmlinux_name == NULL); 256 257 if (params.list_events) { --- 4 unchanged lines hidden (view full) --- 262 if (params.show_lines) { 263 pr_err(" Error: Don't use --list with --line.\n"); 264 usage_with_options(probe_usage, options); 265 } 266 if (params.show_vars) { 267 pr_err(" Error: Don't use --list with --vars.\n"); 268 usage_with_options(probe_usage, options); 269 } | 253 usage_with_options(probe_usage, options); 254 255 /* 256 * Only consider the user's kernel image path if given. 257 */ 258 symbol_conf.try_vmlinux_path = (symbol_conf.vmlinux_name == NULL); 259 260 if (params.list_events) { --- 4 unchanged lines hidden (view full) --- 265 if (params.show_lines) { 266 pr_err(" Error: Don't use --list with --line.\n"); 267 usage_with_options(probe_usage, options); 268 } 269 if (params.show_vars) { 270 pr_err(" Error: Don't use --list with --vars.\n"); 271 usage_with_options(probe_usage, options); 272 } |
273 if (params.show_funcs) { 274 pr_err(" Error: Don't use --list with --funcs.\n"); 275 usage_with_options(probe_usage, options); 276 } |
|
270 ret = show_perf_probe_events(); 271 if (ret < 0) 272 pr_err(" Error: Failed to show event list. (%d)\n", 273 ret); 274 return ret; 275 } | 277 ret = show_perf_probe_events(); 278 if (ret < 0) 279 pr_err(" Error: Failed to show event list. (%d)\n", 280 ret); 281 return ret; 282 } |
283 if (params.show_funcs) { 284 if (params.nevents != 0 || params.dellist) { 285 pr_err(" Error: Don't use --funcs with" 286 " --add/--del.\n"); 287 usage_with_options(probe_usage, options); 288 } 289 if (params.show_lines) { 290 pr_err(" Error: Don't use --funcs with --line.\n"); 291 usage_with_options(probe_usage, options); 292 } 293 if (params.show_vars) { 294 pr_err(" Error: Don't use --funcs with --vars.\n"); 295 usage_with_options(probe_usage, options); 296 } 297 ret = show_available_funcs(params.target_module); 298 if (ret < 0) 299 pr_err(" Error: Failed to show functions." 300 " (%d)\n", ret); 301 return ret; 302 } |
|
276 277#ifdef DWARF_SUPPORT 278 if (params.show_lines) { 279 if (params.mod_events) { 280 pr_err(" Error: Don't use --line with" 281 " --add/--del.\n"); 282 usage_with_options(probe_usage, options); 283 } --- 47 unchanged lines hidden --- | 303 304#ifdef DWARF_SUPPORT 305 if (params.show_lines) { 306 if (params.mod_events) { 307 pr_err(" Error: Don't use --line with" 308 " --add/--del.\n"); 309 usage_with_options(probe_usage, options); 310 } --- 47 unchanged lines hidden --- |