This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [PATCH 1/2] SDT markers listing by perf
- From: Namhyung Kim <namhyung at kernel dot org>
- To: Hemant <hkshaw at linux dot vnet dot ibm dot com>
- Cc: linux-kernel at vger dot kernel dot org, srikar at linux dot vnet dot ibm dot com, peterz at infradead dot org, oleg at redhat dot com, mingo at redhat dot com, anton at redhat dot com, systemtap at sourceware dot org, masami dot hiramatsu dot pt at hitachi dot com
- Date: Fri, 06 Sep 2013 15:37:56 +0900
- Subject: Re: [PATCH 1/2] SDT markers listing by perf
- Authentication-results: sourceware.org; auth=none
- References: <20130903072944 dot 4793 dot 93584 dot stgit at hemant-fedora> <20130903073655 dot 4793 dot 20013 dot stgit at hemant-fedora> <87ioyht7e4 dot fsf at sejong dot aot dot lge dot com> <52276FF5 dot 9050808 at linux dot vnet dot ibm dot com>
Hi Hemant,
On Wed, 04 Sep 2013 23:07:57 +0530, Hemant wrote:
> On 09/04/2013 12:12 PM, Namhyung Kim wrote:
>> On Tue, 03 Sep 2013 13:06:55 +0530, Hemant Kumar wrote:
>>> + /*
>>> + * Look for Section type = SHT_NOTE, flags = no SHF_ALLOC
>>> + * and name = .note.stapsdt
>>> + */
>>> + scn = elf_section_by_name(elf, &ehdr, &shdr, NOTE_SCN, NULL);
>>> + if (scn == NULL) {
>>> + pr_err("%s section not found!\n", NOTE_SCN);
>>> + goto out_end;
>>> + }
>>> +
>>> + if (!(shdr.sh_type == SHT_NOTE) || (shdr.sh_flags & SHF_ALLOC))
>>> + goto out_end;
>>> +
>>> + data = elf_getdata(scn, NULL);
>>> +
>>> + /* Get the notes */
>>> + for (offset = 0; (next = gelf_getnote(data, offset, &nhdr, &name_off,
>>> + &desc_off)) > 0; offset = next) {
>>> + tmp = populate_note(&elf, (const char *)((long)(data->d_buf) +
>>> + (long)desc_off),
>>> + nhdr.n_descsz, nhdr.n_type);
>> Shouldn't we check the name of note being "stapsdt" as well as version
>> (type) 3?
>
> Since, we are already fetching the section NOTE_SCN (".note.stapsdt")
> and then we check for the type being SHT_NOTE and SHF_ALLOC, is it
> required to do the same for the individual notes?
I don't know. Now it seems only includes SDT notes with name being
"stapsdt" and type being 3. But things can be changed in future..
Thanks,
Namhyung