Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 321414
b: refs/heads/master
c: a3f698f
h: refs/heads/master
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo committed Aug 2, 2012
1 parent f8e5bf5 commit e7cf75c
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cb0b29e0861659c9eef9664772cd7e845ba1104a
refs/heads/master: a3f698fe3082ff80a7f3b27c9b64b4b748c81f9d
3 changes: 0 additions & 3 deletions trunk/tools/perf/util/event.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,6 @@ int perf_event__preprocess_sample(const union perf_event *self,

const char *perf_event__name(unsigned int id);

int perf_event__parse_sample(const union perf_event *event, u64 type,
int sample_size, bool sample_id_all,
struct perf_sample *sample, bool swapped);
int perf_event__synthesize_sample(union perf_event *event, u64 type,
const struct perf_sample *sample,
bool swapped);
Expand Down
6 changes: 2 additions & 4 deletions trunk/tools/perf/util/evlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -882,11 +882,9 @@ int perf_evlist__start_workload(struct perf_evlist *evlist)
return 0;
}

int perf_evlist__parse_sample(struct perf_evlist *evlist,
const union perf_event *event,
int perf_evlist__parse_sample(struct perf_evlist *evlist, union perf_event *event,
struct perf_sample *sample, bool swapped)
{
struct perf_evsel *e = list_entry(evlist->entries.next, struct perf_evsel, node);
return perf_event__parse_sample(event, e->attr.sample_type, e->sample_size,
e->attr.sample_id_all, sample, swapped);
return perf_evsel__parse_sample(e, event, sample, swapped);
}
3 changes: 1 addition & 2 deletions trunk/tools/perf/util/evlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ u64 perf_evlist__sample_type(const struct perf_evlist *evlist);
bool perf_evlist__sample_id_all(const const struct perf_evlist *evlist);
u16 perf_evlist__id_hdr_size(const struct perf_evlist *evlist);

int perf_evlist__parse_sample(struct perf_evlist *evlist,
const union perf_event *event,
int perf_evlist__parse_sample(struct perf_evlist *evlist, union perf_event *event,
struct perf_sample *sample, bool swapped);

bool perf_evlist__valid_sample_type(const struct perf_evlist *evlist);
Expand Down
12 changes: 6 additions & 6 deletions trunk/tools/perf/util/evsel.c
Original file line number Diff line number Diff line change
Expand Up @@ -729,10 +729,10 @@ static bool sample_overlap(const union perf_event *event,
return false;
}

int perf_event__parse_sample(const union perf_event *event, u64 type,
int sample_size, bool sample_id_all,
int perf_evsel__parse_sample(struct perf_evsel *evsel, union perf_event *event,
struct perf_sample *data, bool swapped)
{
u64 type = evsel->attr.sample_type;
const u64 *array;

/*
Expand All @@ -747,14 +747,14 @@ int perf_event__parse_sample(const union perf_event *event, u64 type,
data->period = 1;

if (event->header.type != PERF_RECORD_SAMPLE) {
if (!sample_id_all)
if (!evsel->attr.sample_id_all)
return 0;
return perf_event__parse_id_sample(event, type, data, swapped);
}

array = event->sample.array;

if (sample_size + sizeof(event->header) > event->header.size)
if (evsel->sample_size + sizeof(event->header) > event->header.size)
return -EFAULT;

if (type & PERF_SAMPLE_IP) {
Expand Down Expand Up @@ -896,7 +896,7 @@ int perf_event__synthesize_sample(union perf_event *event, u64 type,
u.val32[1] = sample->tid;
if (swapped) {
/*
* Inverse of what is done in perf_event__parse_sample
* Inverse of what is done in perf_evsel__parse_sample
*/
u.val32[0] = bswap_32(u.val32[0]);
u.val32[1] = bswap_32(u.val32[1]);
Expand Down Expand Up @@ -931,7 +931,7 @@ int perf_event__synthesize_sample(union perf_event *event, u64 type,
u.val32[0] = sample->cpu;
if (swapped) {
/*
* Inverse of what is done in perf_event__parse_sample
* Inverse of what is done in perf_evsel__parse_sample
*/
u.val32[0] = bswap_32(u.val32[0]);
u.val64 = bswap_64(u.val64);
Expand Down
2 changes: 2 additions & 0 deletions trunk/tools/perf/util/evsel.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,6 @@ static inline int perf_evsel__read_scaled(struct perf_evsel *evsel,

void hists__init(struct hists *hists);

int perf_evsel__parse_sample(struct perf_evsel *evsel, union perf_event *event,
struct perf_sample *sample, bool swapped);
#endif /* __PERF_EVSEL_H */

0 comments on commit e7cf75c

Please sign in to comment.