Merge tag 'perf-core-for-mingo-20160606' of git://git.kernel.org/pub/scm/linux/kernel...
authorIngo Molnar <mingo@kernel.org>
Wed, 8 Jun 2016 07:29:23 +0000 (09:29 +0200)
committerIngo Molnar <mingo@kernel.org>
Wed, 8 Jun 2016 07:29:23 +0000 (09:29 +0200)
Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:

User visible changes:

- Tooling support for TopDown counters, recently added to the kernel (Andi Kleen)

- Show call graphs in 'perf script' when 1st event doesn't have it but some other has (He Kuang)

- Fix terminal cleanup when handling invalid .perfconfig files in 'perf top' (Taeung Song)

Build fixes:

- Respect CROSS_COMPILE for the linker in libapi (Lucas Stach)

Infrastructure changes:

- Fix perf_evlist__alloc_mmap() failure path (Wang Nan)

- Provide way to extract integer value from format_field (Arnaldo Carvalho de Melo)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
1  2 
tools/perf/util/evsel.c

diff --combined tools/perf/util/evsel.c
@@@ -839,7 -839,7 +839,7 @@@ void perf_evsel__config(struct perf_evs
                perf_evsel__set_sample_bit(evsel, PERIOD);
  
        /*
 -       * When the user explicitely disabled time don't force it here.
 +       * When the user explicitly disabled time don't force it here.
         */
        if (opts->sample_time &&
            (!perf_missing_features.sample_id_all &&
@@@ -2251,17 -2251,11 +2251,11 @@@ void *perf_evsel__rawptr(struct perf_ev
        return sample->raw_data + offset;
  }
  
- u64 perf_evsel__intval(struct perf_evsel *evsel, struct perf_sample *sample,
-                      const char *name)
+ u64 format_field__intval(struct format_field *field, struct perf_sample *sample,
+                        bool needs_swap)
  {
-       struct format_field *field = perf_evsel__field(evsel, name);
-       void *ptr;
        u64 value;
-       if (!field)
-               return 0;
-       ptr = sample->raw_data + field->offset;
+       void *ptr = sample->raw_data + field->offset;
  
        switch (field->size) {
        case 1:
                return 0;
        }
  
-       if (!evsel->needs_swap)
+       if (!needs_swap)
                return value;
  
        switch (field->size) {
        return 0;
  }
  
+ u64 perf_evsel__intval(struct perf_evsel *evsel, struct perf_sample *sample,
+                      const char *name)
+ {
+       struct format_field *field = perf_evsel__field(evsel, name);
+       if (!field)
+               return 0;
+       return field ? format_field__intval(field, sample, evsel->needs_swap) : 0;
+ }
  bool perf_evsel__fallback(struct perf_evsel *evsel, int err,
                          char *msg, size_t msgsize)
  {