diff options
Diffstat (limited to 'tools/perf/builtin-script.c')
-rw-r--r-- | tools/perf/builtin-script.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 2a5b8af80e6b..1764efd16cd4 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c | |||
@@ -3868,24 +3868,9 @@ int cmd_script(int argc, const char **argv) | |||
3868 | script.range_num); | 3868 | script.range_num); |
3869 | } | 3869 | } |
3870 | 3870 | ||
3871 | if (script.evswitch.on_name) { | 3871 | err = evswitch__init(&script.evswitch, session->evlist, stderr); |
3872 | script.evswitch.on = perf_evlist__find_evsel_by_str(session->evlist, script.evswitch.on_name); | 3872 | if (err) |
3873 | if (script.evswitch.on == NULL) { | 3873 | goto out_delete; |
3874 | fprintf(stderr, "switch-on event not found (%s)\n", script.evswitch.on_name); | ||
3875 | err = -ENOENT; | ||
3876 | goto out_delete; | ||
3877 | } | ||
3878 | script.evswitch.discarding = true; | ||
3879 | } | ||
3880 | |||
3881 | if (script.evswitch.off_name) { | ||
3882 | script.evswitch.off = perf_evlist__find_evsel_by_str(session->evlist, script.evswitch.off_name); | ||
3883 | if (script.evswitch.off == NULL) { | ||
3884 | fprintf(stderr, "switch-off event not found (%s)\n", script.evswitch.off_name); | ||
3885 | err = -ENOENT; | ||
3886 | goto out_delete; | ||
3887 | } | ||
3888 | } | ||
3889 | 3874 | ||
3890 | err = __cmd_script(&script); | 3875 | err = __cmd_script(&script); |
3891 | 3876 | ||