mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
perf tools: Rename perf_event_ops to perf_tool
To better reflect that it became the base class for all tools, that must be in each tool struct and where common stuff will be put. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-qgpc4msetqlwr8y2k7537cxe@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
743eb86865
commit
45694aa770
22 changed files with 301 additions and 277 deletions
|
@ -7,6 +7,7 @@
|
|||
#include "util/header.h"
|
||||
#include "util/parse-options.h"
|
||||
#include "util/session.h"
|
||||
#include "util/tool.h"
|
||||
#include "util/symbol.h"
|
||||
#include "util/thread.h"
|
||||
#include "util/trace-event.h"
|
||||
|
@ -434,7 +435,7 @@ static int cleanup_scripting(void)
|
|||
|
||||
static char const *input_name = "perf.data";
|
||||
|
||||
static int process_sample_event(struct perf_event_ops *ops __used,
|
||||
static int process_sample_event(struct perf_tool *tool __used,
|
||||
union perf_event *event,
|
||||
struct perf_sample *sample,
|
||||
struct perf_evsel *evsel,
|
||||
|
@ -468,7 +469,7 @@ static int process_sample_event(struct perf_event_ops *ops __used,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static struct perf_event_ops event_ops = {
|
||||
static struct perf_tool perf_script = {
|
||||
.sample = process_sample_event,
|
||||
.mmap = perf_event__process_mmap,
|
||||
.comm = perf_event__process_comm,
|
||||
|
@ -495,7 +496,7 @@ static int __cmd_script(struct perf_session *session)
|
|||
|
||||
signal(SIGINT, sig_handler);
|
||||
|
||||
ret = perf_session__process_events(session, &event_ops);
|
||||
ret = perf_session__process_events(session, &perf_script);
|
||||
|
||||
if (debug_mode)
|
||||
pr_err("Misordered timestamps: %" PRIu64 "\n", nr_unordered);
|
||||
|
@ -1262,7 +1263,7 @@ int cmd_script(int argc, const char **argv, const char *prefix __used)
|
|||
if (!script_name)
|
||||
setup_pager();
|
||||
|
||||
session = perf_session__new(input_name, O_RDONLY, 0, false, &event_ops);
|
||||
session = perf_session__new(input_name, O_RDONLY, 0, false, &perf_script);
|
||||
if (session == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue