summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2019-09-10 12:17:33 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-09-20 08:19:21 -0400
commitb251892d6ceafa3c8f8e6835a664e248766b1b3e (patch)
treea2e86ee0f7e3cddd5dbc105335a72a4ef1fe359b
parent278306163882a3557fb2c69fd2cc632a2f9ef601 (diff)
perf stat: Move perf_stat_synthesize_config() to event.h
Together with the other synthsizers, and rename it to perf_event__synthesize_stat_events(). This allows us to stop including event.h in util/stat.h. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Link: https://lkml.kernel.org/n/tip-q5ebhrp44txboobs86htu5r9@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/builtin-stat.c4
-rw-r--r--tools/perf/util/event.h5
-rw-r--r--tools/perf/util/stat.c10
-rw-r--r--tools/perf/util/stat.h8
4 files changed, 14 insertions, 13 deletions
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 5bc0c570b7b6..b55e8060810b 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -540,8 +540,8 @@ try_again:
540 if (err < 0) 540 if (err < 0)
541 return err; 541 return err;
542 542
543 err = perf_stat_synthesize_config(&stat_config, NULL, evsel_list, 543 err = perf_event__synthesize_stat_events(&stat_config, NULL, evsel_list,
544 process_synthesized_event, is_pipe); 544 process_synthesized_event, is_pipe);
545 if (err < 0) 545 if (err < 0)
546 return err; 546 return err;
547 } 547 }
diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h
index 4e6d33c76d57..89a2404170a0 100644
--- a/tools/perf/util/event.h
+++ b/tools/perf/util/event.h
@@ -293,6 +293,11 @@ typedef int (*perf_event__handler_t)(struct perf_tool *tool,
293 struct perf_sample *sample, 293 struct perf_sample *sample,
294 struct machine *machine); 294 struct machine *machine);
295 295
296int perf_event__synthesize_stat_events(struct perf_stat_config *config,
297 struct perf_tool *tool,
298 struct evlist *evlist,
299 perf_event__handler_t process,
300 bool attrs);
296int perf_event__synthesize_attr(struct perf_tool *tool, 301int perf_event__synthesize_attr(struct perf_tool *tool,
297 struct perf_event_attr *attr, u32 ids, u64 *id, 302 struct perf_event_attr *attr, u32 ids, u64 *id,
298 perf_event__handler_t process); 303 perf_event__handler_t process);
diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c
index d309c1cc13db..2e318d95c528 100644
--- a/tools/perf/util/stat.c
+++ b/tools/perf/util/stat.c
@@ -495,11 +495,11 @@ int create_perf_stat_counter(struct evsel *evsel,
495 return perf_evsel__open_per_thread(evsel, evsel->core.threads); 495 return perf_evsel__open_per_thread(evsel, evsel->core.threads);
496} 496}
497 497
498int perf_stat_synthesize_config(struct perf_stat_config *config, 498int perf_event__synthesize_stat_events(struct perf_stat_config *config,
499 struct perf_tool *tool, 499 struct perf_tool *tool,
500 struct evlist *evlist, 500 struct evlist *evlist,
501 perf_event__handler_t process, 501 perf_event__handler_t process,
502 bool attrs) 502 bool attrs)
503{ 503{
504 int err; 504 int err;
505 505
diff --git a/tools/perf/util/stat.h b/tools/perf/util/stat.h
index 14fe3e548229..0f9c9f6e2041 100644
--- a/tools/perf/util/stat.h
+++ b/tools/perf/util/stat.h
@@ -7,8 +7,9 @@
7#include <sys/types.h> 7#include <sys/types.h>
8#include <sys/resource.h> 8#include <sys/resource.h>
9#include "rblist.h" 9#include "rblist.h"
10#include "event.h"
11 10
11struct perf_cpu_map;
12struct perf_stat_config;
12struct timespec; 13struct timespec;
13 14
14struct stats { 15struct stats {
@@ -210,11 +211,6 @@ size_t perf_event__fprintf_stat_config(union perf_event *event, FILE *fp);
210int create_perf_stat_counter(struct evsel *evsel, 211int create_perf_stat_counter(struct evsel *evsel,
211 struct perf_stat_config *config, 212 struct perf_stat_config *config,
212 struct target *target); 213 struct target *target);
213int perf_stat_synthesize_config(struct perf_stat_config *config,
214 struct perf_tool *tool,
215 struct evlist *evlist,
216 perf_event__handler_t process,
217 bool attrs);
218void 214void
219perf_evlist__print_counters(struct evlist *evlist, 215perf_evlist__print_counters(struct evlist *evlist,
220 struct perf_stat_config *config, 216 struct perf_stat_config *config,