linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
To: Namhyung Kim <namhyung@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Ingo Molnar <mingo@kernel.org>,
	Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"yrl.pp-manager.tt@hitachi.com" <yrl.pp-manager.tt@hitachi.com>
Subject: Re: Re: [PATCH ftrace/core  2/2] ftrace, kprobes: Support IPMODIFY flag to find IP modify conflict
Date: Thu, 12 Jun 2014 15:57:43 +0900	[thread overview]
Message-ID: <53994F67.9030106@hitachi.com> (raw)
In-Reply-To: <871tuuad02.fsf@sejong.aot.lge.com>

(2014/06/12 14:54), Namhyung Kim wrote:
> On Thu, 12 Jun 2014 12:29:09 +0900, Masami Hiramatsu wrote:
>> NO, ftrace_lookup_ip() returns NULL if the hash is empty, so adding
>> !ftrace_hash_empty() is meaningless :)
>>
>> Actually, here I intended to have 3 meanings for the new/old_hash arguments,
>> - If it is NULL, it hits all
>> - If it is EMPTY_HASH, it hits nothing
>> - If it has some entries, it hits those entries.
>>
>> And in ftrace.c(__ftrace_hash_rec_update), AFAICS, ops->filter_hash has only
>> 2 meanings,
>> - If it is EMPTY_HASH or NULL, it hits all
>> - If it has some entries, it hits those entries.
> 
> Then I found an unrelated issue during review.
> 
> It seems that checking NULL other_hash for the 'all' case in
> __ftrace_hash_rec_update() is not sufficient.  It should check
> EMPTY_HASH case too, but then it ends up removing the check at all since
> it can be covered in ftrace_lookup_ip().

I guessed that was just for speeding up by skipping ftrace_lookup_ip().
(but I'm not sure how much it improves...)

Reviewed-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>

However, I'd like to ask Steven his Ack.

Thank you,

> 
> Thanks,
> Namhyung
> 
> 
> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index 13885590a184..8bd7aa69a479 100644
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -1545,7 +1545,7 @@ static void __ftrace_hash_rec_update(struct ftrace_ops *ops,
>  			 * Only the filter_hash affects all records.
>  			 * Update if the record is not in the notrace hash.
>  			 */
> -			if (!other_hash || !ftrace_lookup_ip(other_hash, rec->ip))
> +			if (!ftrace_lookup_ip(other_hash, rec->ip))
>  				match = 1;
>  		} else {
>  			in_hash = !!ftrace_lookup_ip(hash, rec->ip);
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 


-- 
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Research Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com



  reply	other threads:[~2014-06-12  6:57 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-10 10:50 [PATCH ftrace/core 0/2] ftrace, kprobes: Introduce IPMODIFY flag for ftrace_ops to detect conflicts Masami Hiramatsu
2014-06-10 10:50 ` [PATCH ftrace/core 1/2] ftrace: Simplify ftrace_hash_disable/enable path in ftrace_hash_move Masami Hiramatsu
2014-06-10 10:50 ` [PATCH ftrace/core 2/2] ftrace, kprobes: Support IPMODIFY flag to find IP modify conflict Masami Hiramatsu
2014-06-10 13:53   ` Namhyung Kim
2014-06-11  1:28     ` Masami Hiramatsu
2014-06-11  7:41       ` Namhyung Kim
2014-06-12  3:29         ` Masami Hiramatsu
2014-06-12  5:38           ` Namhyung Kim
2014-06-12  6:06             ` Masami Hiramatsu
2014-06-12  5:54           ` Namhyung Kim
2014-06-12  6:57             ` Masami Hiramatsu [this message]
2014-06-11 16:58 ` [PATCH ftrace/core 0/2] ftrace, kprobes: Introduce IPMODIFY flag for ftrace_ops to detect conflicts Josh Poimboeuf
2014-06-12  3:28   ` Namhyung Kim
2014-06-12 12:50     ` Josh Poimboeuf
2014-06-12  5:44   ` Masami Hiramatsu
2014-06-12 12:43     ` Josh Poimboeuf
2014-06-13 10:09       ` Masami Hiramatsu

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=53994F67.9030106@hitachi.com \
    --to=masami.hiramatsu.pt@hitachi.com \
    --cc=ananth@in.ibm.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@gmail.com \
    --cc=rostedt@goodmis.org \
    --cc=yrl.pp-manager.tt@hitachi.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 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).