Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758162AbaDIBhe (ORCPT ); Tue, 8 Apr 2014 21:37:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43335 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757285AbaDIBhd (ORCPT ); Tue, 8 Apr 2014 21:37:33 -0400 Date: Tue, 8 Apr 2014 21:36:58 -0400 From: Don Zickus To: Namhyung Kim Cc: Jiri Olsa , acme@ghostprotocols.net, LKML , jmario@redhat.com, fowles@inreach.com, peterz@infradead.org, eranian@google.com, andi.kleen@intel.com Subject: Re: [PATCH 05/15 V3] perf, c2c: Rework setup code to prepare for features Message-ID: <20140409013658.GA8488@redhat.com> References: <1395689826-215033-1-git-send-email-dzickus@redhat.com> <1395689826-215033-6-git-send-email-dzickus@redhat.com> <20140329171018.GA2022@krava.redhat.com> <87ob0cw9na.fsf@sejong.aot.lge.com> <20140408141107.GT8488@redhat.com> <87eh17uwzj.fsf@sejong.aot.lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87eh17uwzj.fsf@sejong.aot.lge.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 09, 2014 at 10:12:32AM +0900, Namhyung Kim wrote: > On Tue, 8 Apr 2014 10:11:07 -0400, Don Zickus wrote: > > On Tue, Apr 08, 2014 at 04:41:29PM +0900, Namhyung Kim wrote: > >> On Sat, 29 Mar 2014 18:10:18 +0100, Jiri Olsa wrote: > >> > On Mon, Mar 24, 2014 at 03:36:56PM -0400, Don Zickus wrote: > >> > > >> > SNIP > >> > > >> >> > >> >> static int perf_c2c__process_load_store(struct perf_c2c *c2c, > >> >> + struct addr_location *al, > >> >> struct perf_sample *sample, > >> >> - struct addr_location *al) > >> >> + struct perf_evsel *evsel) > >> >> { > >> >> - if (c2c->raw_records) > >> >> - perf_sample__fprintf(sample, ' ', "raw input", al, stdout); > >> >> + struct mem_info *mi; > >> >> + > >> >> + mi = sample__resolve_mem(sample, al); > >> >> + if (!mi) > >> >> + return -ENOMEM; > >> > > >> > perhaps not directly related to this patchset, but I needed > >> > attached patch to get resolved data in .bss (static), which > >> > for some reason happened to be located in executable segment > >> > >> Wasn't it a read-only/const data? > > > > I believe it had the 'x' bit set. Or the kernel was not passing any > > protection bits, so it defaulted to MAP_FUNCTION? > > The perf treats a mapping as a data mapping (MAP_VARIABLE) by default if > the 'x' bit is not set. As Jiri said its a static data, I guessed it's > a const data (set to 0?) and moved into .rodata section and then to the > text segment. Unfortunately, his patch will be needed eventually, if not for his reason, I had a java JAR file example that was pulling data addresses out of a shared memory region with the protection bits set to 'rwx' (in the /proc//maps area). I was losing lots of samples until I came up with a more complicated hack. I will try to dig up my example, so you can see, so it doesn't sound like I am making this up. :-) Cheers, Don -- 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/