lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 15 Sep 2009 21:33:33 -0400
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Li Zefan <lizf@...fujitsu.com>
Cc:	jolsa@...hat.com, mingo@...e.hu, linux-kernel@...r.kernel.org
Subject: Re: [PATCHv2] tracing - support multiple pids in set_pid_ftrace
 file

On Wed, 2009-09-16 at 09:00 +0800, Li Zefan wrote:
> jolsa@...hat.com wrote:
> > Adding the possibility to set more than 1 pid in the set_pid_ftrace file,
> > thus allowing to trace more than 1 independent processes.
> > 
> > Usage:
> > 
> > sh-4.0# echo 284 > ./set_ftrace_pid 
> > sh-4.0# cat ./set_ftrace_pid 
> > 284
> > sh-4.0# echo 1 >> ./set_ftrace_pid 
> > sh-4.0# echo 0 >> ./set_ftrace_pid 
> > sh-4.0# cat ./set_ftrace_pid 
> > swapper tasks
> > 1
> > 284
> > sh-4.0# echo 4 > ./set_ftrace_pid 
> > sh-4.0# cat ./set_ftrace_pid 
> > 4
> > sh-4.0# echo > ./set_ftrace_pid 
> > sh-4.0# cat ./set_ftrace_pid 
> > no pid
> > sh-4.0# 
> > 
> > 
> > wbr,
> > jirka
> > 
> > Signed-off-by: Jiri Olsa <jolsa@...hat.com>
> 
> Looks good.
> 
> Reviewed-by: Li Zefan <lizf@...fujitsu.com>

Thanks!

> 
> a few nitpicks.
> 
> >  /* set when tracing only a pid */
> 
> This comment should be removed too.

Yeah, it goes with the deleted pointer below.

> 
> > -struct pid *ftrace_pid_trace;
> >  static struct pid * const ftrace_swapper_pid = &init_struct_pid;
> >  
> ...
> > +static int ftrace_pid_add(int p)
> > +{
> > +	struct pid *pid;
> > +	struct ftrace_pid *fpid;
> > +	int ret = -EINVAL;
> > +
> > +	mutex_lock(&ftrace_lock);
> > +
> > +	if (!p)
> > +		pid = ftrace_swapper_pid;
> > +	else
> > +		pid = find_get_pid(p);
> > +
> > +	if (!pid)
> > +		goto out;
> > +
> > +	list_for_each_entry(fpid, &ftrace_pids, list)
> > +		if (fpid->pid == pid)
> > +			goto out_put;
> 
> rather than returning EINVAL, return EEXIST or just return 0?

I agree, return 0, if it already exists, there's no harm in it returning
success.

-- Steve


--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ