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] [day] [month] [year] [list]
Message-ID: <20090915123617.GA26284@jolsa.lab.eng.brq.redhat.com>
Date:	Tue, 15 Sep 2009 14:36:17 +0200
From:	Jiri Olsa <jolsa@...hat.com>
To:	Li Zefan <lizf@...fujitsu.com>
Cc:	mingo@...e.hu, rostedt@...dmis.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] tracing - support multiple pids in set_pid_ftrace file

On Tue, Sep 15, 2009 at 05:40:07PM +0800, Li Zefan wrote:
> jolsa@...hat.com wrote:
SNIP

> > +	list_for_each_entry_safe(fpid, safe, &ftrace_pids, list) {
> > +		struct pid *pid = fpid->pid;
> > +
> > +		clear_ftrace_pid_task(&pid);
> 
> Now we can change clear_ftrace_pid_task() to take struct pid *
> instead of struct pid**.
> 
changed

> > +
> > +		if (pid != ftrace_swapper_pid)
> > +			put_pid(pid);
> > +
> 
> clear_ftrace_pid_task() already called put_pid().
> 
oops, you're right.. missed that

> > +		list_del(&fpid->list);
> > +		kfree(fpid);
> > +	}
> > +
> > +	ftrace_update_pid_func();
> > +	ftrace_startup_enable(0);
> > +
> > +	mutex_unlock(&ftrace_lock);
> > +}
> > +
> ...
> >  static ssize_t
> >  ftrace_pid_write(struct file *filp, const char __user *ubuf,
> >  		   size_t cnt, loff_t *ppos)
> >  {
> > -	struct pid *pid;
> >  	char buf[64];
> >  	long val;
> >  	int ret;
> > @@ -2897,57 +3016,36 @@ ftrace_pid_write(struct file *filp, const char __user *ubuf,
> >  
> >  	buf[cnt] = 0;
> >  
> > +	/*
> > +	 * Allow the "echo > set_ftrace_pid" to clean
> > +	 * the pids quietly.
> > +	 */
> > +	if (!*ppos && *buf == '\n' && cnt == 1)
> > +		return 1;
> > +
> 
> How about:
> 	strstrip(buf);
> 	if (strlen(buf) == 0)
> 		return 1;
> 
thats better, changed

> So "echo -n '' > set_ftrace_pid" works too.
> 
> >  	ret = strict_strtol(buf, 10, &val);
> >  	if (ret < 0)
> >  		return ret;
> >  
> 

I'll send out v2 shortly, thanks
jirka
--
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