public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	James Bottomley <James.Bottomley@suse.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Paul Mackerras <paulus@samba.org>,
	"Frank Ch. Eigler" <fche@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] x86: record relocation offset
Date: Fri, 1 Jan 2010 10:27:33 +0100	[thread overview]
Message-ID: <20100101092733.GA12203@elte.hu> (raw)
In-Reply-To: <20091231103609.GE2384@ghostprotocols.net>


* Arnaldo Carvalho de Melo <acme@infradead.org> wrote:

> Em Thu, Dec 31, 2009 at 11:00:00AM +0800, Xiao Guangrong escreveu:
> > Arnaldo Carvalho de Melo wrote:
> 
> > > Conclusion: at 'perf record' time store the address of a well know
> > > symbol (_text) into the perf.data header. Later, at perf report time, if
> > > using a vmlinux file, calculate the relocation by subtracting the same
> > > well known symbol from the one stored in the header.
> 
> > > So no need for ioctl or boot stuff.
> 
> > I'm little confused, how to get the load symbol address?
> > It's not a good way, if you get it from '/proc/kallsyms', we can't assume kernel
> > has this file.
> 
> Well, then its just a matter of exposing _text as 
> /sys/kernel/sections/.text, as we already have for modules:
> 
> [acme@ana linux-2.6-tip]$ cat /sys/module/ipv6/sections/.text 
> 0xfa0c2000
> 
> Which matches
> 
> nf_conntrack_ipv6 17548 2 - Live 0xfa147000
> ipv6 239420 32 ip6t_REJECT,nf_conntrack_ipv6, Live 0xfa0c2000
> [acme@ana linux-2.6-tip]$

Yeah, that's a good idea and pretty complementary to the existing scheme for 
modules.

> But even as a quick transational assist, we can look at kallsyms at 'perf 
> record' time.

Yes, we should do that as a fallback mechanism.

(Initially this 'fallback' will be the primary method, until the 
sections/.text extension gets merged upstream.)

Thanks,

	Ingo

  parent reply	other threads:[~2010-01-01  9:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-30 23:26 [PATCH 1/3] x86: record relocation offset H. Peter Anvin
2009-12-30 23:41 ` James Bottomley
2009-12-30 23:46   ` H. Peter Anvin
2009-12-31  0:30     ` Arnaldo Carvalho de Melo
2009-12-31  3:00       ` Xiao Guangrong
2009-12-31 10:36         ` Arnaldo Carvalho de Melo
2009-12-31 10:50           ` Xiao Guangrong
2010-01-01  9:27           ` Ingo Molnar [this message]
2009-12-31  2:58     ` Xiao Guangrong
2009-12-31  0:53   ` Frank Ch. Eigler
  -- strict thread matches above, loose matches on Subject: below --
2009-12-30 22:09 H. Peter Anvin
2009-12-30  3:15 [PATCH 0/3] perf_event: fix getting symbol error if kernel is relocatable Xiao Guangrong
2009-12-30  3:16 ` [PATCH 1/3] x86: record relocation offset Xiao Guangrong
2009-12-30 13:15   ` Arnaldo Carvalho de Melo
2009-12-30 19:45     ` H. Peter Anvin
2009-12-30 20:39       ` Arnaldo Carvalho de Melo
2009-12-30 21:58         ` Arnaldo Carvalho de Melo
2009-12-30 22:22           ` James Bottomley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100101092733.GA12203@elte.hu \
    --to=mingo@elte.hu \
    --cc=James.Bottomley@suse.de \
    --cc=acme@infradead.org \
    --cc=fche@redhat.com \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=xiaoguangrong@cn.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox