2009-09-28 13:32:55 +00:00
|
|
|
#ifndef __PERF_HIST_H
|
|
|
|
#define __PERF_HIST_H
|
|
|
|
|
2009-12-14 15:10:39 +00:00
|
|
|
#include <linux/types.h>
|
2011-10-05 20:50:23 +00:00
|
|
|
#include <pthread.h>
|
2009-09-28 13:32:55 +00:00
|
|
|
#include "callchain.h"
|
|
|
|
|
|
|
|
extern struct callchain_param callchain_param;
|
|
|
|
|
2009-12-14 15:10:39 +00:00
|
|
|
struct hist_entry;
|
|
|
|
struct addr_location;
|
|
|
|
struct symbol;
|
2010-05-12 02:18:06 +00:00
|
|
|
|
2010-05-14 16:16:55 +00:00
|
|
|
/*
|
|
|
|
* The kernel collects the number of events it couldn't send in a stretch and
|
|
|
|
* when possible sends this number in a PERF_RECORD_LOST event. The number of
|
|
|
|
* such "chunks" of lost events is stored in .nr_events[PERF_EVENT_LOST] while
|
|
|
|
* total_lost tells exactly how many events the kernel in fact lost, i.e. it is
|
|
|
|
* the sum of all struct lost_event.lost fields reported.
|
|
|
|
*
|
|
|
|
* The total_period is needed because by default auto-freq is used, so
|
|
|
|
* multipling nr_events[PERF_EVENT_SAMPLE] by a frequency isn't possible to get
|
|
|
|
* the total number of low level events, it is necessary to to sum all struct
|
|
|
|
* sample_event.period and stash the result in total_period.
|
|
|
|
*/
|
perf hist: Introduce hists class and move lots of methods to it
In cbbc79a we introduced support for multiple events by introducing a
new "event_stat_id" struct and then made several perf_session methods
receive a point to it instead of a pointer to perf_session, and kept the
event_stats and hists rb_tree in perf_session.
While working on the new newt based browser, I realised that it would be
better to introduce a new class, "hists" (short for "histograms"),
renaming the "event_stat_id" struct and the perf_session methods that
were really "hists" methods, as they manipulate only struct hists
members, not touching anything in the other perf_session members.
Other optimizations, such as calculating the maximum lenght of a symbol
name present in an hists instance will be possible as we add them,
avoiding a re-traversal just for finding that information.
The rationale for the name "hists" to replace "event_stat_id" is that we
may have multiple sets of hists for the same event_stat id, as, for
instance, the 'perf diff' tool has, so event stat id is not what
characterizes what this struct and the functions that manipulate it do.
Cc: Eric B Munson <ebmunson@us.ibm.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-05-10 16:04:11 +00:00
|
|
|
struct events_stats {
|
2010-05-14 16:16:55 +00:00
|
|
|
u64 total_period;
|
|
|
|
u64 total_lost;
|
perf session: Parse sample earlier
At perf_session__process_event, so that we reduce the number of lines in eache
tool sample processing routine that now receives a sample_data pointer already
parsed.
This will also be useful in the next patch, where we'll allow sample the
identity fields in MMAP, FORK, EXIT, etc, when it will be possible to see (cpu,
timestamp) just after before every event.
Also validate callchains in perf_session__process_event, i.e. as early as
possible, and keep a counter of the number of events discarded due to invalid
callchains, warning the user about it if it happens.
There is an assumption that was kept that all events have the same sample_type,
that will be dealt with in the future, when this preexisting limitation will be
removed.
Tested-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Ian Munsie <imunsie@au1.ibm.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Ian Munsie <imunsie@au1.ibm.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Stephane Eranian <eranian@google.com>
LKML-Reference: <1291318772-30880-4-git-send-email-acme@infradead.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-12-02 16:10:21 +00:00
|
|
|
u64 total_invalid_chains;
|
2010-05-14 13:36:42 +00:00
|
|
|
u32 nr_events[PERF_RECORD_HEADER_MAX];
|
2011-10-29 14:15:04 +00:00
|
|
|
u32 nr_lost_warned;
|
2010-05-14 13:36:42 +00:00
|
|
|
u32 nr_unknown_events;
|
perf session: Parse sample earlier
At perf_session__process_event, so that we reduce the number of lines in eache
tool sample processing routine that now receives a sample_data pointer already
parsed.
This will also be useful in the next patch, where we'll allow sample the
identity fields in MMAP, FORK, EXIT, etc, when it will be possible to see (cpu,
timestamp) just after before every event.
Also validate callchains in perf_session__process_event, i.e. as early as
possible, and keep a counter of the number of events discarded due to invalid
callchains, warning the user about it if it happens.
There is an assumption that was kept that all events have the same sample_type,
that will be dealt with in the future, when this preexisting limitation will be
removed.
Tested-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Ian Munsie <imunsie@au1.ibm.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Ian Munsie <imunsie@au1.ibm.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Stephane Eranian <eranian@google.com>
LKML-Reference: <1291318772-30880-4-git-send-email-acme@infradead.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-12-02 16:10:21 +00:00
|
|
|
u32 nr_invalid_chains;
|
2011-03-15 18:44:01 +00:00
|
|
|
u32 nr_unknown_id;
|
2012-02-10 17:05:04 +00:00
|
|
|
u32 nr_unprocessable_samples;
|
perf hist: Introduce hists class and move lots of methods to it
In cbbc79a we introduced support for multiple events by introducing a
new "event_stat_id" struct and then made several perf_session methods
receive a point to it instead of a pointer to perf_session, and kept the
event_stats and hists rb_tree in perf_session.
While working on the new newt based browser, I realised that it would be
better to introduce a new class, "hists" (short for "histograms"),
renaming the "event_stat_id" struct and the perf_session methods that
were really "hists" methods, as they manipulate only struct hists
members, not touching anything in the other perf_session members.
Other optimizations, such as calculating the maximum lenght of a symbol
name present in an hists instance will be possible as we add them,
avoiding a re-traversal just for finding that information.
The rationale for the name "hists" to replace "event_stat_id" is that we
may have multiple sets of hists for the same event_stat id, as, for
instance, the 'perf diff' tool has, so event stat id is not what
characterizes what this struct and the functions that manipulate it do.
Cc: Eric B Munson <ebmunson@us.ibm.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-05-10 16:04:11 +00:00
|
|
|
};
|
|
|
|
|
2010-07-20 17:42:52 +00:00
|
|
|
enum hist_column {
|
|
|
|
HISTC_SYMBOL,
|
|
|
|
HISTC_DSO,
|
|
|
|
HISTC_THREAD,
|
|
|
|
HISTC_COMM,
|
|
|
|
HISTC_PARENT,
|
|
|
|
HISTC_CPU,
|
2012-02-09 22:21:01 +00:00
|
|
|
HISTC_MISPREDICT,
|
|
|
|
HISTC_SYMBOL_FROM,
|
|
|
|
HISTC_SYMBOL_TO,
|
|
|
|
HISTC_DSO_FROM,
|
|
|
|
HISTC_DSO_TO,
|
2012-05-30 13:33:24 +00:00
|
|
|
HISTC_SRCLINE,
|
2010-07-20 17:42:52 +00:00
|
|
|
HISTC_NR_COLS, /* Last entry */
|
|
|
|
};
|
|
|
|
|
2011-10-18 21:07:34 +00:00
|
|
|
struct thread;
|
|
|
|
struct dso;
|
|
|
|
|
perf hist: Introduce hists class and move lots of methods to it
In cbbc79a we introduced support for multiple events by introducing a
new "event_stat_id" struct and then made several perf_session methods
receive a point to it instead of a pointer to perf_session, and kept the
event_stats and hists rb_tree in perf_session.
While working on the new newt based browser, I realised that it would be
better to introduce a new class, "hists" (short for "histograms"),
renaming the "event_stat_id" struct and the perf_session methods that
were really "hists" methods, as they manipulate only struct hists
members, not touching anything in the other perf_session members.
Other optimizations, such as calculating the maximum lenght of a symbol
name present in an hists instance will be possible as we add them,
avoiding a re-traversal just for finding that information.
The rationale for the name "hists" to replace "event_stat_id" is that we
may have multiple sets of hists for the same event_stat id, as, for
instance, the 'perf diff' tool has, so event stat id is not what
characterizes what this struct and the functions that manipulate it do.
Cc: Eric B Munson <ebmunson@us.ibm.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-05-10 16:04:11 +00:00
|
|
|
struct hists {
|
2011-10-05 20:50:23 +00:00
|
|
|
struct rb_root entries_in_array[2];
|
|
|
|
struct rb_root *entries_in;
|
perf hist: Introduce hists class and move lots of methods to it
In cbbc79a we introduced support for multiple events by introducing a
new "event_stat_id" struct and then made several perf_session methods
receive a point to it instead of a pointer to perf_session, and kept the
event_stats and hists rb_tree in perf_session.
While working on the new newt based browser, I realised that it would be
better to introduce a new class, "hists" (short for "histograms"),
renaming the "event_stat_id" struct and the perf_session methods that
were really "hists" methods, as they manipulate only struct hists
members, not touching anything in the other perf_session members.
Other optimizations, such as calculating the maximum lenght of a symbol
name present in an hists instance will be possible as we add them,
avoiding a re-traversal just for finding that information.
The rationale for the name "hists" to replace "event_stat_id" is that we
may have multiple sets of hists for the same event_stat id, as, for
instance, the 'perf diff' tool has, so event stat id is not what
characterizes what this struct and the functions that manipulate it do.
Cc: Eric B Munson <ebmunson@us.ibm.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-05-10 16:04:11 +00:00
|
|
|
struct rb_root entries;
|
2011-10-05 20:50:23 +00:00
|
|
|
struct rb_root entries_collapsed;
|
2010-05-10 16:57:51 +00:00
|
|
|
u64 nr_entries;
|
2011-10-18 21:07:34 +00:00
|
|
|
const struct thread *thread_filter;
|
|
|
|
const struct dso *dso_filter;
|
2012-01-19 16:08:15 +00:00
|
|
|
const char *uid_filter_str;
|
2012-03-16 08:50:51 +00:00
|
|
|
const char *symbol_filter_str;
|
2011-10-05 20:50:23 +00:00
|
|
|
pthread_mutex_t lock;
|
perf hist: Introduce hists class and move lots of methods to it
In cbbc79a we introduced support for multiple events by introducing a
new "event_stat_id" struct and then made several perf_session methods
receive a point to it instead of a pointer to perf_session, and kept the
event_stats and hists rb_tree in perf_session.
While working on the new newt based browser, I realised that it would be
better to introduce a new class, "hists" (short for "histograms"),
renaming the "event_stat_id" struct and the perf_session methods that
were really "hists" methods, as they manipulate only struct hists
members, not touching anything in the other perf_session members.
Other optimizations, such as calculating the maximum lenght of a symbol
name present in an hists instance will be possible as we add them,
avoiding a re-traversal just for finding that information.
The rationale for the name "hists" to replace "event_stat_id" is that we
may have multiple sets of hists for the same event_stat id, as, for
instance, the 'perf diff' tool has, so event stat id is not what
characterizes what this struct and the functions that manipulate it do.
Cc: Eric B Munson <ebmunson@us.ibm.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-05-10 16:04:11 +00:00
|
|
|
struct events_stats stats;
|
|
|
|
u64 event_stream;
|
2010-07-20 17:42:52 +00:00
|
|
|
u16 col_len[HISTC_NR_COLS];
|
perf hist: Introduce hists class and move lots of methods to it
In cbbc79a we introduced support for multiple events by introducing a
new "event_stat_id" struct and then made several perf_session methods
receive a point to it instead of a pointer to perf_session, and kept the
event_stats and hists rb_tree in perf_session.
While working on the new newt based browser, I realised that it would be
better to introduce a new class, "hists" (short for "histograms"),
renaming the "event_stat_id" struct and the perf_session methods that
were really "hists" methods, as they manipulate only struct hists
members, not touching anything in the other perf_session members.
Other optimizations, such as calculating the maximum lenght of a symbol
name present in an hists instance will be possible as we add them,
avoiding a re-traversal just for finding that information.
The rationale for the name "hists" to replace "event_stat_id" is that we
may have multiple sets of hists for the same event_stat id, as, for
instance, the 'perf diff' tool has, so event stat id is not what
characterizes what this struct and the functions that manipulate it do.
Cc: Eric B Munson <ebmunson@us.ibm.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-05-10 16:04:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct hist_entry *__hists__add_entry(struct hists *self,
|
|
|
|
struct addr_location *al,
|
2010-05-14 17:19:35 +00:00
|
|
|
struct symbol *parent, u64 period);
|
2012-01-04 14:27:03 +00:00
|
|
|
int64_t hist_entry__cmp(struct hist_entry *left, struct hist_entry *right);
|
|
|
|
int64_t hist_entry__collapse(struct hist_entry *left, struct hist_entry *right);
|
2012-08-20 04:52:06 +00:00
|
|
|
int hist_entry__sort_snprintf(struct hist_entry *self, char *bf, size_t size,
|
|
|
|
struct hists *hists);
|
2009-12-14 15:10:39 +00:00
|
|
|
void hist_entry__free(struct hist_entry *);
|
|
|
|
|
2012-02-09 22:21:01 +00:00
|
|
|
struct hist_entry *__hists__add_branch_entry(struct hists *self,
|
|
|
|
struct addr_location *al,
|
|
|
|
struct symbol *sym_parent,
|
|
|
|
struct branch_info *bi,
|
|
|
|
u64 period);
|
|
|
|
|
2010-05-10 16:57:51 +00:00
|
|
|
void hists__output_resort(struct hists *self);
|
2011-10-05 20:50:23 +00:00
|
|
|
void hists__output_resort_threaded(struct hists *hists);
|
perf hist: Introduce hists class and move lots of methods to it
In cbbc79a we introduced support for multiple events by introducing a
new "event_stat_id" struct and then made several perf_session methods
receive a point to it instead of a pointer to perf_session, and kept the
event_stats and hists rb_tree in perf_session.
While working on the new newt based browser, I realised that it would be
better to introduce a new class, "hists" (short for "histograms"),
renaming the "event_stat_id" struct and the perf_session methods that
were really "hists" methods, as they manipulate only struct hists
members, not touching anything in the other perf_session members.
Other optimizations, such as calculating the maximum lenght of a symbol
name present in an hists instance will be possible as we add them,
avoiding a re-traversal just for finding that information.
The rationale for the name "hists" to replace "event_stat_id" is that we
may have multiple sets of hists for the same event_stat id, as, for
instance, the 'perf diff' tool has, so event stat id is not what
characterizes what this struct and the functions that manipulate it do.
Cc: Eric B Munson <ebmunson@us.ibm.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-05-10 16:04:11 +00:00
|
|
|
void hists__collapse_resort(struct hists *self);
|
2011-10-05 20:50:23 +00:00
|
|
|
void hists__collapse_resort_threaded(struct hists *hists);
|
2010-05-14 13:36:42 +00:00
|
|
|
|
2011-10-17 11:05:04 +00:00
|
|
|
void hists__decay_entries(struct hists *hists, bool zap_user, bool zap_kernel);
|
|
|
|
void hists__decay_entries_threaded(struct hists *hists, bool zap_user,
|
|
|
|
bool zap_kernel);
|
perf top: Reuse the 'report' hist_entry/hists classes
This actually fixes several problems we had in the old 'perf top':
1. Unresolved symbols not show, limitation that came from the old
"KernelTop" codebase, to solve it we would need to do changes
that would make sym_entry have most of the hist_entry fields.
2. It was using the number of samples, not the sum of sample->period.
And brings the --sort code that allows us to have all the views in
'perf report', for instance:
[root@emilia ~]# perf top --sort dso
PerfTop: 5903 irqs/sec kernel:77.5% exact: 0.0% [1000Hz cycles], (all, 8 CPUs)
------------------------------------------------------------------------------
31.59% libcrypto.so.1.0.0
21.55% [kernel]
18.57% libpython2.6.so.1.0
7.04% libc-2.12.so
6.99% _backend_agg.so
4.72% sshd
1.48% multiarray.so
1.39% libfreetype.so.6.3.22
1.37% perf
0.71% libgobject-2.0.so.0.2200.5
0.53% [tg3]
0.48% libglib-2.0.so.0.2200.5
0.44% libstdc++.so.6.0.13
0.40% libcairo.so.2.10800.8
0.38% libm-2.12.so
0.34% umath.so
0.30% libgdk-x11-2.0.so.0.1800.9
0.22% libpthread-2.12.so
0.20% libgtk-x11-2.0.so.0.1800.9
0.20% librt-2.12.so
0.15% _path.so
0.13% libpango-1.0.so.0.2800.1
0.11% libatlas.so.3.0
0.09% ft2font.so
0.09% libpangoft2-1.0.so.0.2800.1
0.08% libX11.so.6.3.0
0.07% [vdso]
0.06% cyclictest
^C
All the filter lists can be used as well: --dsos, --comms, --symbols,
etc.
The 'perf report' TUI is also reused, being possible to apply all the
zoom operations, do annotation, etc.
This change will allow multiple simplifications in the symbol system as
well, that will be detailed in upcoming changesets.
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-xzaaldxq7zhqrrxdxjifk1mh@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2011-10-05 22:16:15 +00:00
|
|
|
void hists__output_recalc_col_len(struct hists *hists, int max_rows);
|
|
|
|
|
2010-05-14 13:36:42 +00:00
|
|
|
void hists__inc_nr_events(struct hists *self, u32 type);
|
|
|
|
size_t hists__fprintf_nr_events(struct hists *self, FILE *fp);
|
|
|
|
|
perf hist: Introduce hists class and move lots of methods to it
In cbbc79a we introduced support for multiple events by introducing a
new "event_stat_id" struct and then made several perf_session methods
receive a point to it instead of a pointer to perf_session, and kept the
event_stats and hists rb_tree in perf_session.
While working on the new newt based browser, I realised that it would be
better to introduce a new class, "hists" (short for "histograms"),
renaming the "event_stat_id" struct and the perf_session methods that
were really "hists" methods, as they manipulate only struct hists
members, not touching anything in the other perf_session members.
Other optimizations, such as calculating the maximum lenght of a symbol
name present in an hists instance will be possible as we add them,
avoiding a re-traversal just for finding that information.
The rationale for the name "hists" to replace "event_stat_id" is that we
may have multiple sets of hists for the same event_stat id, as, for
instance, the 'perf diff' tool has, so event stat id is not what
characterizes what this struct and the functions that manipulate it do.
Cc: Eric B Munson <ebmunson@us.ibm.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-05-10 16:04:11 +00:00
|
|
|
size_t hists__fprintf(struct hists *self, struct hists *pair,
|
2011-09-26 15:46:11 +00:00
|
|
|
bool show_displacement, bool show_header,
|
|
|
|
int max_rows, int max_cols, FILE *fp);
|
2010-05-11 14:10:15 +00:00
|
|
|
|
2011-02-04 15:43:24 +00:00
|
|
|
int hist_entry__inc_addr_samples(struct hist_entry *self, int evidx, u64 addr);
|
2011-02-08 15:27:39 +00:00
|
|
|
int hist_entry__annotate(struct hist_entry *self, size_t privsize);
|
2010-05-12 02:18:06 +00:00
|
|
|
|
2011-10-18 21:07:34 +00:00
|
|
|
void hists__filter_by_dso(struct hists *hists);
|
|
|
|
void hists__filter_by_thread(struct hists *hists);
|
2012-03-16 08:50:51 +00:00
|
|
|
void hists__filter_by_symbol(struct hists *hists);
|
2010-05-11 14:10:15 +00:00
|
|
|
|
2010-07-20 17:42:52 +00:00
|
|
|
u16 hists__col_len(struct hists *self, enum hist_column col);
|
|
|
|
void hists__set_col_len(struct hists *self, enum hist_column col, u16 len);
|
|
|
|
bool hists__new_col_len(struct hists *self, enum hist_column col, u16 len);
|
2012-08-20 04:52:05 +00:00
|
|
|
void hists__reset_col_len(struct hists *hists);
|
|
|
|
void hists__calc_col_len(struct hists *hists, struct hist_entry *he);
|
2010-07-20 17:42:52 +00:00
|
|
|
|
2012-09-03 02:53:06 +00:00
|
|
|
struct perf_hpp {
|
|
|
|
char *buf;
|
|
|
|
size_t size;
|
|
|
|
u64 total_period;
|
|
|
|
const char *sep;
|
|
|
|
long displacement;
|
|
|
|
void *ptr;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct perf_hpp_fmt {
|
|
|
|
bool cond;
|
|
|
|
int (*header)(struct perf_hpp *hpp);
|
|
|
|
int (*width)(struct perf_hpp *hpp);
|
|
|
|
int (*color)(struct perf_hpp *hpp, struct hist_entry *he);
|
|
|
|
int (*entry)(struct perf_hpp *hpp, struct hist_entry *he);
|
|
|
|
};
|
|
|
|
|
|
|
|
extern struct perf_hpp_fmt perf_hpp__format[];
|
|
|
|
|
|
|
|
enum {
|
|
|
|
PERF_HPP__OVERHEAD,
|
|
|
|
PERF_HPP__OVERHEAD_SYS,
|
|
|
|
PERF_HPP__OVERHEAD_US,
|
|
|
|
PERF_HPP__OVERHEAD_GUEST_SYS,
|
|
|
|
PERF_HPP__OVERHEAD_GUEST_US,
|
|
|
|
PERF_HPP__SAMPLES,
|
|
|
|
PERF_HPP__PERIOD,
|
|
|
|
PERF_HPP__DELTA,
|
|
|
|
PERF_HPP__DISPL,
|
|
|
|
|
|
|
|
PERF_HPP__MAX_INDEX
|
|
|
|
};
|
|
|
|
|
|
|
|
void perf_hpp__init(bool need_pair, bool show_displacement);
|
|
|
|
int hist_entry__period_snprintf(struct perf_hpp *hpp, struct hist_entry *he,
|
|
|
|
bool color);
|
|
|
|
|
2011-03-06 00:40:06 +00:00
|
|
|
struct perf_evlist;
|
|
|
|
|
2010-05-11 14:10:15 +00:00
|
|
|
#ifdef NO_NEWT_SUPPORT
|
2011-03-06 16:07:30 +00:00
|
|
|
static inline
|
2012-09-10 22:15:03 +00:00
|
|
|
int perf_evlist__tui_browse_hists(struct perf_evlist *evlist __maybe_unused,
|
|
|
|
const char *help __maybe_unused,
|
|
|
|
void(*timer)(void *arg) __maybe_unused,
|
|
|
|
void *arg __maybe_unused,
|
|
|
|
int refresh __maybe_unused)
|
2010-05-24 01:36:51 +00:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-09-10 22:15:03 +00:00
|
|
|
static inline int hist_entry__tui_annotate(struct hist_entry *self
|
|
|
|
__maybe_unused,
|
|
|
|
int evidx __maybe_unused,
|
|
|
|
void(*timer)(void *arg)
|
|
|
|
__maybe_unused,
|
|
|
|
void *arg __maybe_unused,
|
|
|
|
int delay_secs __maybe_unused)
|
2010-05-22 14:25:40 +00:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2011-10-20 18:59:15 +00:00
|
|
|
#define K_LEFT -1
|
|
|
|
#define K_RIGHT -2
|
2010-05-11 14:10:15 +00:00
|
|
|
#else
|
2012-04-04 07:14:26 +00:00
|
|
|
#include "../ui/keysyms.h"
|
2011-11-12 00:17:32 +00:00
|
|
|
int hist_entry__tui_annotate(struct hist_entry *he, int evidx,
|
2011-10-05 22:11:32 +00:00
|
|
|
void(*timer)(void *arg), void *arg, int delay_secs);
|
2010-05-24 01:36:51 +00:00
|
|
|
|
2011-10-05 22:11:32 +00:00
|
|
|
int perf_evlist__tui_browse_hists(struct perf_evlist *evlist, const char *help,
|
|
|
|
void(*timer)(void *arg), void *arg,
|
|
|
|
int refresh);
|
2010-05-11 14:10:15 +00:00
|
|
|
#endif
|
2010-07-21 20:58:25 +00:00
|
|
|
|
2012-03-19 18:13:29 +00:00
|
|
|
#ifdef NO_GTK2_SUPPORT
|
|
|
|
static inline
|
2012-09-10 22:15:03 +00:00
|
|
|
int perf_evlist__gtk_browse_hists(struct perf_evlist *evlist __maybe_unused,
|
|
|
|
const char *help __maybe_unused,
|
|
|
|
void(*timer)(void *arg) __maybe_unused,
|
|
|
|
void *arg __maybe_unused,
|
|
|
|
int refresh __maybe_unused)
|
2012-03-19 18:13:29 +00:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#else
|
|
|
|
int perf_evlist__gtk_browse_hists(struct perf_evlist *evlist, const char *help,
|
|
|
|
void(*timer)(void *arg), void *arg,
|
|
|
|
int refresh);
|
|
|
|
#endif
|
|
|
|
|
2010-07-21 20:58:25 +00:00
|
|
|
unsigned int hists__sort_list_width(struct hists *self);
|
|
|
|
|
2009-09-28 13:32:55 +00:00
|
|
|
#endif /* __PERF_HIST_H */
|