linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: fweisbec@gmail.com, mingo@redhat.com,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, patches@linaro.org,
	linaro-kernel@lists.linaro.org, shaojie.sun@linaro.org
Subject: Re: [PATCH V2] ARM: trace: Add tracepoint for the Inter Processor Interrupt
Date: Sat, 26 Oct 2013 00:25:55 +0200	[thread overview]
Message-ID: <526AEFF3.3060609@linaro.org> (raw)
In-Reply-To: <1382688595.6143.5.camel@pippen.local.home>

On 10/25/2013 10:09 AM, Steven Rostedt wrote:
> On Fri, 2013-10-25 at 08:49 +0200, Daniel Lezcano wrote:
>> On 10/15/2013 02:10 PM, Daniel Lezcano wrote:
>>> The Inter Processor Interrupt is used on ARM to tell another processor to do
>>> a specific action. This is mainly used to emulate a timer interrupt on an idle
>>> cpu, force a cpu to reschedule or run a function on another processor context.
>>>
>>> Add a tracepoint when raising an IPI and in the entry/exit handler functions.
>>>
>>> When a cpu raises an IPI, the targeted cpus is an interesting information, the
>>> cpumask conversion in hexa is added in the trace using the cpumask_scnprintf
>>> function.
>>>
>>> Tested-on Vexpress TC2 (5 processors).
>>>
>>> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
>>
>> Hi All,
>>
>> does this patch sound good for inclusion ?
>
> Ug, I never sent my email. It was half written and in my drafts folder.

That's just typical ! I think no one can say it never happened :)

> I'll reply below.
>

[ ... ]

>>> +/**
>>> + * ipi_raise - called when a smp cross call is made
>>> + * @ipinr: the IPI number
>>> + * @cpumask: the recipients for the IPI
>>> + *
>>> + * The @ipinr value must be valid and the action name associated with
>>> + * the IPI value is given in the trace as well as the cpumask of the
>>> + * targeted cpus.
>>> + */
>>> +TRACE_EVENT_CONDITION(ipi_raise,
>>> +
>>> +    TP_PROTO(const struct cpumask *cpumask, int ipinr),
>>> +
>>> +    TP_ARGS(cpumask, ipinr),
>>> +
>>> +    TP_CONDITION(ipinr < NR_IPI && ipinr >= 0),
>>> +
>>> +    TP_STRUCT__entry(
>>> +	    __field(int, ipinr)
>>> +	    __array(char, cpumask, NR_CPUS)
>>> +    ),
>>> +
>>> +    TP_fast_assign(
>>> +	    __entry->ipinr = ipinr;
>>> +	    cpumask_scnprintf(__entry->cpumask,
>>> +			      ARRAY_SIZE(__entry->cpumask), cpumask);
>
> Please do not do the scnprintf() in the TP_fast_assign(). It's heavy
> weight and this is done in the code path. Just copy the actual cpumask
> itself.

Ok.

> Now, how to do that exactly is the reason I never sent my original mail,
> because I never got around to looking how to do it, but it is possible.
> Unfortunately, I'm at Kernel Summit at the moment, and still don't have
> time to look at the best way to do it. But you can use dynamic arrays
> for the cpus_online.
>
>>> +    ),
>>> +
>>> +    TP_printk("ipi=%d, cpumask=0x%s, name=%s", __entry->ipinr, __entry->cpumask,
>>> +	      show_ipi_name(__entry->ipinr))
>
> Here is where you can convert the cpumask saved in the ring buffer to a
> snprintf() format. Now this may need some work too, and perhaps even a
> handler to help. I thought there was already some printk format that
> does cpumasks.
>
> If the helpers are not there, then I can work on adding some.

I don't find any helper in the code except cpumask_scnprintf. If you 
don't have the time, I can do the adequate changes with some advices.

Thanks
   -- Daniel

>>> +);
>>> +
>>> +#endif /* _TRACE_IPI_H */
>>> +
>>> +/* This part must be outside protection */
>>> +#include <trace/define_trace.h>
>>>
>>
>>
>
>


-- 
  <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


      reply	other threads:[~2013-10-25 22:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-15 12:10 [PATCH V2] ARM: trace: Add tracepoint for the Inter Processor Interrupt Daniel Lezcano
2013-10-17  7:58 ` Daniel Lezcano
2013-10-25  6:49 ` Daniel Lezcano
2013-10-25  8:09   ` Steven Rostedt
2013-10-25 22:25     ` Daniel Lezcano [this message]

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=526AEFF3.3060609@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=fweisbec@gmail.com \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=patches@linaro.org \
    --cc=rostedt@goodmis.org \
    --cc=shaojie.sun@linaro.org \
    /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;
as well as URLs for NNTP newsgroup(s).