perf evswitch: Move struct to a separate header to use in other tools
tip-bot for Arnaldo Carvalho de Melo
merge botCommit-ID: d2360442725fd29b3189887476c57059854a398c Gitweb: https://git.kernel.org/tip/d2360442725fd29b3189887476c57059854a398c Author: Arnaldo Carvalho de Melo <[email protected]> AuthorDate: Thu, 15 Aug 2019 10:37:24 -0300 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Thu, 15 Aug 2019 12:24:24 -0300
perf evswitch: Move struct to a separate header to use in other tools
Now that we see that the simple userspace-based "slicing" of events using delimiter events ("markers") works, lets move it to a separate header to make it available to other tools, next step will be having the switch on/off check done at the PERF_RECORD_SAMPLE processing function moved too.
Cc Adrian Hunter <[email protected]>
Cc Florian Weimer <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc William Cohen <[email protected]>
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>
--- tools/perf/builtin-script.c | 8 +------- tools/perf/util/evswitch.h | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 7 deletions(-)
tools/perf/builtin-script.c +1 -7
@@ -16,6 +16,7 @@#include "util/trace-event.h" #include "util/evlist.h" #include "util/evsel.h" +#include "util/evswitch.h" #include "util/sort.h" #include "util/data.h" #include "util/auxtrace.h"
@@ -1616,13 +1617,6 @@ static int perf_sample__fprintf_synth(struct perf_sample *sample,return 0 ; } -struct evswitch { -struct evsel *on, - *off; -bool discarding; -bool show_on_off_events; -}; -struct perf_script {struct perf_tool tool;struct perf_session *session;
tools/perf/util/evswitch.h new file +16 -0
@@ -0,0 +1,16 @@ +// SPDX-License-Identifier: GPL-2.0-only +// Copyright (C) 2019, Red Hat Inc, Arnaldo Carvalho de Melo <[email protected]> +#ifndef __PERF_EVSWITCH_H +#define __PERF_EVSWITCH_H 1 + +#include <stdbool.h> + +struct evsel ; + +struct evswitch { +struct evsel *on, *off; +bool discarding; +bool show_on_off_events; +}; + +#endif /* __PERF_EVSWITCH_H */