Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753524Ab0DCLyx (ORCPT ); Sat, 3 Apr 2010 07:54:53 -0400 Received: from ozlabs.org ([203.10.76.45]:42506 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753417Ab0DCLyt (ORCPT ); Sat, 3 Apr 2010 07:54:49 -0400 Date: Sat, 3 Apr 2010 22:53:31 +1100 From: Anton Blanchard To: David Miller , Peter Zijlstra , Paul Mackerras , Ingo Molnar , Arnaldo Carvalho de Melo Cc: linux-kernel@vger.kernel.org Subject: [PATCH] perf symbols: Fill in pgoff in mmap synthesized events Message-ID: <20100403115331.GK5594@kryten> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1422 Lines: 42 When we synthesize mmap events we need to fill in the pgoff field. Signed-off-by: Anton Blanchard --- I wasn't able to test this completely since I couldn't find an executable region with a non 0 offset. We will see it when we start doing data profiling. Index: linux.trees.git/tools/perf/util/event.c =================================================================== --- linux.trees.git.orig/tools/perf/util/event.c 2010-04-01 07:55:13.000000000 +1100 +++ linux.trees.git/tools/perf/util/event.c 2010-04-03 22:45:02.000000000 +1100 @@ -130,6 +130,7 @@ static int event__synthesize_mmap_events continue; pbf += n + 3; if (*pbf == 'x') { /* vm_exec */ + u64 vm_pgoff; char *execname = strchr(bf, '/'); /* Catch VDSO */ @@ -139,6 +140,14 @@ static int event__synthesize_mmap_events if (execname == NULL) continue; + pbf += 3; + n = hex2u64(pbf, &vm_pgoff); + /* pgoff is in bytes, not pages */ + if (n >= 0) + ev.mmap.pgoff = vm_pgoff << getpagesize(); + else + ev.mmap.pgoff = 0; + size = strlen(execname); execname[size - 1] = '\0'; /* Remove \n */ memcpy(ev.mmap.filename, execname, size); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/