~ubuntu-branches/debian/experimental/linux-tools/experimental

« back to all changes in this revision

Viewing changes to tools/perf/builtin-diff.c

  • Committer: Package Import Robot
  • Author(s): Ben Hutchings
  • Date: 2014-02-02 16:57:49 UTC
  • mfrom: (1.1.10) (0.1.21 sid)
  • Revision ID: package-import@ubuntu.com-20140202165749-tw94o9t1t0a8txk6
Tags: 3.13-1~exp2
Merge changes from sid up to 3.12.6-3

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
#include "util/sort.h"
17
17
#include "util/symbol.h"
18
18
#include "util/util.h"
 
19
#include "util/data.h"
19
20
 
20
21
#include <stdlib.h>
21
22
#include <math.h>
42
43
 
43
44
struct data__file {
44
45
        struct perf_session     *session;
45
 
        const char              *file;
 
46
        struct perf_data_file   file;
46
47
        int                      idx;
47
48
        struct hists            *hists;
48
49
        struct diff_hpp_fmt      fmt[PERF_HPP_DIFF__MAX_INDEX];
302
303
        return -1;
303
304
}
304
305
 
305
 
static int hists__add_entry(struct hists *self,
 
306
static int hists__add_entry(struct hists *hists,
306
307
                            struct addr_location *al, u64 period,
307
 
                            u64 weight)
 
308
                            u64 weight, u64 transaction)
308
309
{
309
 
        if (__hists__add_entry(self, al, NULL, period, weight) != NULL)
 
310
        if (__hists__add_entry(hists, al, NULL, NULL, NULL, period, weight,
 
311
                               transaction) != NULL)
310
312
                return 0;
311
313
        return -ENOMEM;
312
314
}
328
330
        if (al.filtered)
329
331
                return 0;
330
332
 
331
 
        if (hists__add_entry(&evsel->hists, &al, sample->period, sample->weight)) {
 
333
        if (hists__add_entry(&evsel->hists, &al, sample->period,
 
334
                             sample->weight, sample->transaction)) {
332
335
                pr_warning("problem incrementing symbol period, skipping event\n");
333
336
                return -1;
334
337
        }
367
370
        list_for_each_entry(evsel, &evlist->entries, node) {
368
371
                struct hists *hists = &evsel->hists;
369
372
 
370
 
                hists__collapse_resort(hists);
 
373
                hists__collapse_resort(hists, NULL);
371
374
        }
372
375
}
373
376
 
599
602
 
600
603
        data__for_each_file(i, d)
601
604
                fprintf(stdout, "#  [%d] %s %s\n",
602
 
                        d->idx, d->file,
 
605
                        d->idx, d->file.path,
603
606
                        !d->idx ? "(Baseline)" : "");
604
607
 
605
608
        fprintf(stdout, "#\n");
661
664
        int ret = -EINVAL, i;
662
665
 
663
666
        data__for_each_file(i, d) {
664
 
                d->session = perf_session__new(d->file, O_RDONLY, force,
665
 
                                               false, &tool);
 
667
                d->session = perf_session__new(&d->file, false, &tool);
666
668
                if (!d->session) {
667
 
                        pr_err("Failed to open %s\n", d->file);
 
669
                        pr_err("Failed to open %s\n", d->file.path);
668
670
                        ret = -ENOMEM;
669
671
                        goto out_delete;
670
672
                }
671
673
 
672
674
                ret = perf_session__process_events(d->session, &tool);
673
675
                if (ret) {
674
 
                        pr_err("Failed to process %s\n", d->file);
 
676
                        pr_err("Failed to process %s\n", d->file.path);
675
677
                        goto out_delete;
676
678
                }
677
679
 
1014
1016
                return -ENOMEM;
1015
1017
 
1016
1018
        data__for_each_file(i, d) {
1017
 
                d->file = use_default ? defaults[i] : argv[i];
 
1019
                struct perf_data_file *file = &d->file;
 
1020
 
 
1021
                file->path  = use_default ? defaults[i] : argv[i];
 
1022
                file->mode  = PERF_DATA_MODE_READ,
 
1023
                file->force = force,
 
1024
 
1018
1025
                d->idx  = i;
1019
1026
        }
1020
1027