[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <f646d7ae-5f03-c6bb-9118-de5fed5842dd@linux.vnet.ibm.com>
Date: Fri, 2 Mar 2018 09:24:56 +0530
From: Ravi Bangoria <ravi.bangoria@...ux.vnet.ibm.com>
To: Masami Hiramatsu <mhiramat@...nel.org>
Cc: peterz@...radead.org, mingo@...hat.com, acme@...nel.org,
alexander.shishkin@...ux.intel.com, jolsa@...hat.com,
namhyung@...nel.org, linux-kernel@...r.kernel.org,
rostedt@...dmis.org, ananth@...ux.vnet.ibm.com,
naveen.n.rao@...ux.vnet.ibm.com, srikar@...ux.vnet.ibm.com,
oleg@...hat.com, Ravi Bangoria <ravi.bangoria@...ux.vnet.ibm.com>
Subject: Re: [RFC 3/4] trace_uprobe: Support SDT markers having semaphore
On 03/01/2018 07:37 PM, Masami Hiramatsu wrote:
> On Wed, 28 Feb 2018 13:23:44 +0530
> Ravi Bangoria <ravi.bangoria@...ux.vnet.ibm.com> wrote:
>
>> @@ -502,6 +504,16 @@ static int create_trace_uprobe(int argc, char **argv)
>> for (i = 0; i < argc && i < MAX_TRACE_ARGS; i++) {
>> struct probe_arg *parg = &tu->tp.args[i];
>>
>> + /* This is not really an argument. */
>> + if (argv[i][0] == '*') {
>> + ret = kstrtoul(&(argv[i][1]), 0, &tu->sdt_offset);
>> + if (ret) {
>> + pr_info("Invalid semaphore address.\n");
>> + goto error;
>> + }
>> + continue;
>> + }
> So, this part should be done with parsing probe-point as I pointed.
Yes, will change it.
>> +static void sdt_increment_sem(struct trace_uprobe *tu)
>> +{
>> + struct uprobe_map_info *info;
>> + struct vm_area_struct *vma;
>> + unsigned long vaddr;
>> +
>> + uprobe_start_dup_mmap();
>> + info = build_uprobe_map_info(tu->inode->i_mapping, tu->sdt_offset, false);
>> + if (IS_ERR(info))
>> + goto out;
>> +
>> + while (info) {
>> + down_write(&info->mm->mmap_sem);
>> + vma = sdt_find_vma(info->mm, tu);
>> + if (!vma)
>> + goto cont;
>> +
>> + vaddr = offset_to_vaddr(vma, tu->sdt_offset);
>> + sdt_update_sem(info->mm, vaddr, 1);
>> +
>> +cont:
> Why would you use goto here?
Hmm.. sdt_find_vma() must return vma. Sure, will remove the goto.
Should I add a WARN_ON(!vma) ?
Thanks for the review,
Ravi
Powered by blists - more mailing lists