All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
To: Masami Hiramatsu <mhiramat@kernel.org>
Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org,
	alexander.shishkin@linux.intel.com, jolsa@redhat.com,
	namhyung@kernel.org, linux-kernel@vger.kernel.org,
	rostedt@goodmis.org, ananth@linux.vnet.ibm.com,
	naveen.n.rao@linux.vnet.ibm.com, srikar@linux.vnet.ibm.com,
	oleg@redhat.com, Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Subject: Re: [RFC 3/4] trace_uprobe: Support SDT markers having semaphore
Date: Fri, 2 Mar 2018 09:24:56 +0530	[thread overview]
Message-ID: <f646d7ae-5f03-c6bb-9118-de5fed5842dd@linux.vnet.ibm.com> (raw)
In-Reply-To: <20180301230741.bf15b2ab4c4913303e54884a@kernel.org>



On 03/01/2018 07:37 PM, Masami Hiramatsu wrote:
> On Wed, 28 Feb 2018 13:23:44 +0530
> Ravi Bangoria <ravi.bangoria@linux.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

  reply	other threads:[~2018-03-02  3:53 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-28  7:53 [RFC 0/4] trace_uprobe: Support SDT markers having semaphore Ravi Bangoria
2018-02-28  7:53 ` [RFC 1/4] Uprobe: Rename map_info to uprobe_map_info Ravi Bangoria
2018-02-28 12:09   ` Srikar Dronamraju
2018-03-01  5:11     ` Ravi Bangoria
2018-02-28  7:53 ` [RFC 2/4] Uprobe: Export few functions / data structures Ravi Bangoria
2018-02-28 12:24   ` Srikar Dronamraju
2018-03-01  5:25     ` Ravi Bangoria
2018-03-01  5:25       ` Ravi Bangoria
2018-02-28  7:53 ` [RFC 3/4] trace_uprobe: Support SDT markers having semaphore Ravi Bangoria
2018-03-01 14:07   ` Masami Hiramatsu
2018-03-02  3:54     ` Ravi Bangoria [this message]
2018-03-06 11:59   ` Peter Zijlstra
2018-03-07  8:46     ` Ravi Bangoria
2018-03-07  8:57       ` Peter Zijlstra
2018-02-28  7:53 ` [RFC 4/4] trace_uprobe: Fix multiple update of same semaphores Ravi Bangoria
2018-02-28 12:06 ` [RFC 0/4] trace_uprobe: Support SDT markers having semaphore Srikar Dronamraju
2018-03-01  5:10   ` Ravi Bangoria
2018-02-28 14:25 ` Masami Hiramatsu
2018-03-01  5:32   ` Ravi Bangoria

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=f646d7ae-5f03-c6bb-9118-de5fed5842dd@linux.vnet.ibm.com \
    --to=ravi.bangoria@linux.vnet.ibm.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=ananth@linux.vnet.ibm.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=naveen.n.rao@linux.vnet.ibm.com \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=srikar@linux.vnet.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.