[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <52638B44.2030800@linux.vnet.ibm.com>
Date: Sun, 20 Oct 2013 13:20:28 +0530
From: Hemant Kumar <hkshaw@...ux.vnet.ibm.com>
To: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
CC: linux-kernel@...r.kernel.org, srikar@...ux.vnet.ibm.com,
peterz@...radead.org, oleg@...hat.com,
hegdevasant@...ux.vnet.ibm.com, mingo@...hat.com, anton@...hat.com,
systemtap@...rceware.org, namhyung@...nel.org,
aravinda@...ux.vnet.ibm.com
Subject: Re: [PATCH v3 2/3] Support for perf to probe into SDT markers:
On 10/19/2013 09:18 PM, Masami Hiramatsu wrote:
> [...]
> +
> + /*
> + * Find out the .stapsdt.base section.
> + * This scn will help us to handle prelinking (if present).
> + * Compare the retrieved file offset of the base section with the
> + * base address in the description of the SDT note. If its different,
> + * then accordingly, adjust the note location.
> + */
> + if (elf_section_by_name(elf, &ehdr, &shdr, SDT_BASE_SCN, NULL))
> + base_off = shdr.sh_offset;
> + if (base_off) {
> + if (tmp->bit32)
> + key->addr.a32[0] = tmp->addr.a32[0] + base_off -
> + tmp->addr.a32[1];
> + else
> + key->addr.a64[0] = tmp->addr.a64[0] + base_off -
> + tmp->addr.a64[1];
> + }
> + key->bit32 = tmp->bit32;
> +}
> +
> +int search_sdt_note(struct sdt_note *key, struct list_head *sdt_notes,
> + const char *target)
> Hmm, this interface looks very odd.
> - This just finds the first matched sdt_note entry instead of the list.
> In that case, we don't need to pass the list_head.
> - If the purpose is just counting the number of matched entries (or just
> checking existence), we also don't need the list. Just returning the
> number is enough.
>
> I recommend you to remove the "sdt_notes", and make the caller check
> key->addr is set.
Yeah, list isn't required in this case. Thanks for pointing that out.
Will change that.
> [...]
>
--
Thanks
Hemant Kumar
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists