From f4d834367cda98eee3769638da6ad687607c74e6 Mon Sep 17 00:00:00 2001 From: Robert Richter Date: Thu, 16 Aug 2012 21:10:17 +0200 Subject: perf tools: Fix type for evsel->ids and add size check for ids Use same type for ids everywhere. In case of writing to perf.data the size is u32. In pipe mode it is limited to header.size (less than u16). Adding a size check here. Size overflow due to casting shouldn't actually happen in practice, but during development this may cause type missmatch warninngs/errors, unifying types avoids this. Signed-off-by: Robert Richter Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1345144224-27280-2-git-send-email-robert.richter@amd.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/header.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/perf/util/header.h') diff --git a/tools/perf/util/header.h b/tools/perf/util/header.h index 2d42b3e1826f..24962e707e5b 100644 --- a/tools/perf/util/header.h +++ b/tools/perf/util/header.h @@ -99,7 +99,7 @@ int build_id_cache__add_s(const char *sbuild_id, const char *debugdir, int build_id_cache__remove_s(const char *sbuild_id, const char *debugdir); int perf_event__synthesize_attr(struct perf_tool *tool, - struct perf_event_attr *attr, u16 ids, u64 *id, + struct perf_event_attr *attr, u32 ids, u64 *id, perf_event__handler_t process); int perf_event__synthesize_attrs(struct perf_tool *tool, struct perf_session *session, -- cgit v1.2.3