Commit fc284be9 authored by Namhyung Kim's avatar Namhyung Kim Committed by Arnaldo Carvalho de Melo

perf hists: Export a couple of hist functions

These are necessary for multi threaded sample processing:

 - hists__get__get_rotate_entries_in()
 - hists__collapse_insert_entry()
 - __hists__init()
Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Noel Grandin <noelgrandin@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1452158050-28061-14-git-send-email-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 21e6d842
...@@ -1007,9 +1007,8 @@ void hist_entry__delete(struct hist_entry *he) ...@@ -1007,9 +1007,8 @@ void hist_entry__delete(struct hist_entry *he)
* collapse the histogram * collapse the histogram
*/ */
static bool hists__collapse_insert_entry(struct hists *hists __maybe_unused, bool hists__collapse_insert_entry(struct hists *hists __maybe_unused,
struct rb_root *root, struct rb_root *root, struct hist_entry *he)
struct hist_entry *he)
{ {
struct rb_node **p = &root->rb_node; struct rb_node **p = &root->rb_node;
struct rb_node *parent = NULL; struct rb_node *parent = NULL;
...@@ -1049,7 +1048,7 @@ static bool hists__collapse_insert_entry(struct hists *hists __maybe_unused, ...@@ -1049,7 +1048,7 @@ static bool hists__collapse_insert_entry(struct hists *hists __maybe_unused,
return true; return true;
} }
static struct rb_root *hists__get_rotate_entries_in(struct hists *hists) struct rb_root *hists__get_rotate_entries_in(struct hists *hists)
{ {
struct rb_root *root; struct rb_root *root;
...@@ -1584,10 +1583,8 @@ int perf_hist_config(const char *var, const char *value) ...@@ -1584,10 +1583,8 @@ int perf_hist_config(const char *var, const char *value)
return 0; return 0;
} }
static int hists_evsel__init(struct perf_evsel *evsel) int __hists__init(struct hists *hists)
{ {
struct hists *hists = evsel__hists(evsel);
memset(hists, 0, sizeof(*hists)); memset(hists, 0, sizeof(*hists));
hists->entries_in_array[0] = hists->entries_in_array[1] = RB_ROOT; hists->entries_in_array[0] = hists->entries_in_array[1] = RB_ROOT;
hists->entries_in = &hists->entries_in_array[0]; hists->entries_in = &hists->entries_in_array[0];
...@@ -1627,6 +1624,14 @@ static void hists_evsel__exit(struct perf_evsel *evsel) ...@@ -1627,6 +1624,14 @@ static void hists_evsel__exit(struct perf_evsel *evsel)
hists__delete_all_entries(hists); hists__delete_all_entries(hists);
} }
static int hists_evsel__init(struct perf_evsel *evsel)
{
struct hists *hists = evsel__hists(evsel);
__hists__init(hists);
return 0;
}
/* /*
* XXX We probably need a hists_evsel__exit() to free the hist_entries * XXX We probably need a hists_evsel__exit() to free the hist_entries
* stored in the rbtree... * stored in the rbtree...
......
...@@ -185,6 +185,11 @@ static inline struct hists *evsel__hists(struct perf_evsel *evsel) ...@@ -185,6 +185,11 @@ static inline struct hists *evsel__hists(struct perf_evsel *evsel)
} }
int hists__init(void); int hists__init(void);
int __hists__init(struct hists *hists);
struct rb_root *hists__get_rotate_entries_in(struct hists *hists);
bool hists__collapse_insert_entry(struct hists *hists __maybe_unused,
struct rb_root *root, struct hist_entry *he);
struct perf_hpp { struct perf_hpp {
char *buf; char *buf;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment