Prev: perf trace: Fix array handling & value truncation
Next: [PATCH 4/7] perf trace: Rewind pointer in case field in header_page is missing
From: Ian Munsie on 13 May 2010 02:10 From: Ian Munsie <imunsie(a)au1.ibm.com> This patch makes the failure case where the size that read_size is passed is invalid kill perf immediately rather than silently failing, so that further bugs or regressions using read_size can be found more easily and squashed early. Signed-off-by: Ian Munsie <imunsie(a)au1.ibm.com> --- tools/perf/util/trace-event-parse.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c index 73a0222..8f470f6 100644 --- a/tools/perf/util/trace-event-parse.c +++ b/tools/perf/util/trace-event-parse.c @@ -1912,8 +1912,7 @@ unsigned long long read_size(void *ptr, int size) case 8: return data2host8(ptr); default: - /* BUG! */ - return 0; + die("read_size BUG: Invalid size %d", size); } } -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |