perf stat: Move perf_stat_synthesize_config() to event.h
authorArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 10 Sep 2019 16:17:33 +0000 (17:17 +0100)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 20 Sep 2019 12:19:21 +0000 (09:19 -0300)
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>
tools/perf/builtin-stat.c
tools/perf/util/event.h
tools/perf/util/stat.c
tools/perf/util/stat.h

index 5bc0c570b7b60268bf190bb1739ffcf22f6c8411..b55e8060810b5345b28675790c13f46f353e1874 100644 (file)
@@ -540,8 +540,8 @@ try_again:
                if (err < 0)
                        return err;
 
-               err = perf_stat_synthesize_config(&stat_config, NULL, evsel_list,
-                                                 process_synthesized_event, is_pipe);
+               err = perf_event__synthesize_stat_events(&stat_config, NULL, evsel_list,
+                                                        process_synthesized_event, is_pipe);
                if (err < 0)
                        return err;
        }
index 4e6d33c76d572bc863256b62dc5fb905775fab0b..89a2404170a00c8ce453e6884c9aa53af92e1baa 100644 (file)
@@ -293,6 +293,11 @@ typedef int (*perf_event__handler_t)(struct perf_tool *tool,
                                     struct perf_sample *sample,
                                     struct machine *machine);
 
+int perf_event__synthesize_stat_events(struct perf_stat_config *config,
+                                      struct perf_tool *tool,
+                                      struct evlist *evlist,
+                                      perf_event__handler_t process,
+                                      bool attrs);
 int perf_event__synthesize_attr(struct perf_tool *tool,
                                struct perf_event_attr *attr, u32 ids, u64 *id,
                                perf_event__handler_t process);
index d309c1cc13db3b2ec50d7dad71d98eee6176148b..2e318d95c528d0e874e78d12b31a98772338d9a5 100644 (file)
@@ -495,11 +495,11 @@ int create_perf_stat_counter(struct evsel *evsel,
        return perf_evsel__open_per_thread(evsel, evsel->core.threads);
 }
 
-int perf_stat_synthesize_config(struct perf_stat_config *config,
-                               struct perf_tool *tool,
-                               struct evlist *evlist,
-                               perf_event__handler_t process,
-                               bool attrs)
+int perf_event__synthesize_stat_events(struct perf_stat_config *config,
+                                      struct perf_tool *tool,
+                                      struct evlist *evlist,
+                                      perf_event__handler_t process,
+                                      bool attrs)
 {
        int err;
 
index 14fe3e548229fcc2f8b29bc637791db5f9aa953a..0f9c9f6e2041b2e4727219bd3d32ed24a844b923 100644 (file)
@@ -7,8 +7,9 @@
 #include <sys/types.h>
 #include <sys/resource.h>
 #include "rblist.h"
-#include "event.h"
 
+struct perf_cpu_map;
+struct perf_stat_config;
 struct timespec;
 
 struct stats {
@@ -210,11 +211,6 @@ size_t perf_event__fprintf_stat_config(union perf_event *event, FILE *fp);
 int create_perf_stat_counter(struct evsel *evsel,
                             struct perf_stat_config *config,
                             struct target *target);
-int perf_stat_synthesize_config(struct perf_stat_config *config,
-                               struct perf_tool *tool,
-                               struct evlist *evlist,
-                               perf_event__handler_t process,
-                               bool attrs);
 void
 perf_evlist__print_counters(struct evlist *evlist,
                            struct perf_stat_config *config,