[PATCH 16/29] perf evsel: Synthesize PERF_SAMPLE_TRANSACTION

2013-11-04 Thread Arnaldo Carvalho de Melo
From: Adrian Hunter 

Add missing PERF_SAMPLE_TRANSACTION to perf_event__synthesize_sample()
and perf_event__sample_event_size().

This makes the "sample parsing" test pass.

Signed-off-by: Adrian Hunter 
Cc: Andi Kleen 
Cc: David Ahern 
Cc: Frederic Weisbecker 
Cc: Ingo Molnar 
Cc: Jiri Olsa 
Cc: Mike Galbraith 
Cc: Namhyung Kim 
Cc: Paul Mackerras 
Cc: Peter Zijlstra 
Cc: Stephane Eranian 
Link: 
http://lkml.kernel.org/r/1383313899-15987-11-git-send-email-adrian.hun...@intel.com
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/util/evsel.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index b121717ce42a..5280820ed389 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -1578,6 +1578,9 @@ size_t perf_event__sample_event_size(const struct 
perf_sample *sample, u64 type,
if (type & PERF_SAMPLE_DATA_SRC)
result += sizeof(u64);
 
+   if (type & PERF_SAMPLE_TRANSACTION)
+   result += sizeof(u64);
+
return result;
 }
 
@@ -1751,6 +1754,11 @@ int perf_event__synthesize_sample(union perf_event 
*event, u64 type,
array++;
}
 
+   if (type & PERF_SAMPLE_TRANSACTION) {
+   *array = sample->transaction;
+   array++;
+   }
+
return 0;
 }
 
-- 
1.8.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 16/29] perf evsel: Synthesize PERF_SAMPLE_TRANSACTION

2013-11-04 Thread Arnaldo Carvalho de Melo
From: Adrian Hunter adrian.hun...@intel.com

Add missing PERF_SAMPLE_TRANSACTION to perf_event__synthesize_sample()
and perf_event__sample_event_size().

This makes the sample parsing test pass.

Signed-off-by: Adrian Hunter adrian.hun...@intel.com
Cc: Andi Kleen a...@firstfloor.org
Cc: David Ahern dsah...@gmail.com
Cc: Frederic Weisbecker fweis...@gmail.com
Cc: Ingo Molnar mi...@redhat.com
Cc: Jiri Olsa jo...@redhat.com
Cc: Mike Galbraith efa...@gmx.de
Cc: Namhyung Kim namhy...@gmail.com
Cc: Paul Mackerras pau...@samba.org
Cc: Peter Zijlstra a.p.zijls...@chello.nl
Cc: Stephane Eranian eran...@google.com
Link: 
http://lkml.kernel.org/r/1383313899-15987-11-git-send-email-adrian.hun...@intel.com
Signed-off-by: Arnaldo Carvalho de Melo a...@redhat.com
---
 tools/perf/util/evsel.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index b121717ce42a..5280820ed389 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -1578,6 +1578,9 @@ size_t perf_event__sample_event_size(const struct 
perf_sample *sample, u64 type,
if (type  PERF_SAMPLE_DATA_SRC)
result += sizeof(u64);
 
+   if (type  PERF_SAMPLE_TRANSACTION)
+   result += sizeof(u64);
+
return result;
 }
 
@@ -1751,6 +1754,11 @@ int perf_event__synthesize_sample(union perf_event 
*event, u64 type,
array++;
}
 
+   if (type  PERF_SAMPLE_TRANSACTION) {
+   *array = sample-transaction;
+   array++;
+   }
+
return 0;
 }
 
-- 
1.8.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/