Merge tag 'pinctrl-v3.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw...
[cascardo/linux.git] / tools / perf / util / evsel.h
index 163c560..3862274 100644 (file)
@@ -36,6 +36,9 @@ struct perf_sample_id {
        struct hlist_node       node;
        u64                     id;
        struct perf_evsel       *evsel;
+       int                     idx;
+       int                     cpu;
+       pid_t                   tid;
 
        /* Holds total ID period value for PERF_SAMPLE_READ processing. */
        u64                     period;
@@ -54,6 +57,7 @@ struct cgroup_sel;
  * @is_pos: the position (counting backwards) of the event id (PERF_SAMPLE_ID or
  *          PERF_SAMPLE_IDENTIFIER) in a non-sample event i.e. if sample_id_all
  *          is used there is an id sample appended to non-sample events
+ * @priv:   And what is in its containing unnamed union are tool specific
  */
 struct perf_evsel {
        struct list_head        node;
@@ -69,10 +73,12 @@ struct perf_evsel {
        char                    *name;
        double                  scale;
        const char              *unit;
+       bool                    snapshot;
        struct event_format     *tp_format;
        union {
                void            *priv;
                off_t           id_offset;
+               u64             db_id;
        };
        struct cgroup_sel       *cgrp;
        void                    *handler;
@@ -86,6 +92,8 @@ struct perf_evsel {
        bool                    immediate;
        bool                    system_wide;
        bool                    tracking;
+       bool                    per_pkg;
+       unsigned long           *per_pkg_mask;
        /* parse modifier helper */
        int                     exclude_GH;
        int                     nr_members;
@@ -105,6 +113,12 @@ struct thread_map;
 struct perf_evlist;
 struct record_opts;
 
+void perf_counts_values__scale(struct perf_counts_values *count,
+                              bool scale, s8 *pscaled);
+
+void perf_evsel__compute_deltas(struct perf_evsel *evsel, int cpu,
+                               struct perf_counts_values *count);
+
 int perf_evsel__object_config(size_t object_size,
                              int (*init)(struct perf_evsel *evsel),
                              void (*fini)(struct perf_evsel *evsel));
@@ -222,6 +236,13 @@ static inline bool perf_evsel__match2(struct perf_evsel *e1,
         (a)->attr.type == (b)->attr.type &&    \
         (a)->attr.config == (b)->attr.config)
 
+typedef int (perf_evsel__read_cb_t)(struct perf_evsel *evsel,
+                                   int cpu, int thread,
+                                   struct perf_counts_values *count);
+
+int perf_evsel__read_cb(struct perf_evsel *evsel, int cpu, int thread,
+                       perf_evsel__read_cb_t cb);
+
 int __perf_evsel__read_on_cpu(struct perf_evsel *evsel,
                              int cpu, int thread, bool scale);
 
@@ -251,35 +272,6 @@ static inline int perf_evsel__read_on_cpu_scaled(struct perf_evsel *evsel,
        return __perf_evsel__read_on_cpu(evsel, cpu, thread, true);
 }
 
-int __perf_evsel__read(struct perf_evsel *evsel, int ncpus, int nthreads,
-                      bool scale);
-
-/**
- * perf_evsel__read - Read the aggregate results on all CPUs
- *
- * @evsel - event selector to read value
- * @ncpus - Number of cpus affected, from zero
- * @nthreads - Number of threads affected, from zero
- */
-static inline int perf_evsel__read(struct perf_evsel *evsel,
-                                   int ncpus, int nthreads)
-{
-       return __perf_evsel__read(evsel, ncpus, nthreads, false);
-}
-
-/**
- * perf_evsel__read_scaled - Read the aggregate results on all CPUs, scaled
- *
- * @evsel - event selector to read value
- * @ncpus - Number of cpus affected, from zero
- * @nthreads - Number of threads affected, from zero
- */
-static inline int perf_evsel__read_scaled(struct perf_evsel *evsel,
-                                         int ncpus, int nthreads)
-{
-       return __perf_evsel__read(evsel, ncpus, nthreads, true);
-}
-
 int perf_evsel__parse_sample(struct perf_evsel *evsel, union perf_event *event,
                             struct perf_sample *sample);