From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751202AbaALEd0 (ORCPT ); Sat, 11 Jan 2014 23:33:26 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:58913 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750958AbaALEdX (ORCPT ); Sat, 11 Jan 2014 23:33:23 -0500 From: Gaurav Jain To: CC: Gaurav Jain , Ingo Molnar , Jiri Olsa , Paul Mackerras , Peter Zijlstra , Don Zickus , Arun Sharma Subject: [PATCH] perf tools: Synthesize anon MMAP records on the heap Date: Sat, 11 Jan 2014 20:32:14 -0800 Message-ID: <1389501134-13116-1-git-send-email-gjain@fb.com> X-Mailer: git-send-email 1.8.5.2 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [192.168.16.4] X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.11.87,1.0.14,0.0.0000 definitions=2014-01-12_01:2014-01-10,2014-01-12,1970-01-01 signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Anon records usually do not have the 'execname' entry. However if they are on the heap, the execname shows up as '[heap]'. The fix considers any executable entries in the map that do not have a name or are on the heap as anon records and sets the name to '//anon'. This fixes JIT profiling for records on the heap. Signed-off-by: Gaurav Jain Cc: Ingo Molnar Cc: Jiri Olsa Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Don Zickus Cc: Arun Sharma --- tools/perf/util/event.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index bb788c1..ae9c55b 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c @@ -224,10 +224,9 @@ static int perf_event__synthesize_mmap_events(struct perf_tool *tool, continue; event->header.misc |= PERF_RECORD_MISC_MMAP_DATA; - } - - if (!strcmp(execname, "")) + } if (!strcmp(execname, "") || !strcmp(execname, "[heap]")) { strcpy(execname, anonstr); + } size = strlen(execname) + 1; memcpy(event->mmap.filename, execname, size); -- 1.8.1