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]
Message-ID: <20180109132745.GA13256@krava>
Date:   Tue, 9 Jan 2018 14:27:45 +0100
From:   Jiri Olsa <jolsa@...hat.com>
To:     Arnaldo Carvalho de Melo <acme@...nel.org>
Cc:     Namhyung Kim <namhyung@...nel.org>, Jiri Olsa <jolsa@...nel.org>,
        Peter Zijlstra <a.p.zijlstra@...llo.nl>,
        lkml <linux-kernel@...r.kernel.org>,
        Ingo Molnar <mingo@...nel.org>,
        David Ahern <dsahern@...il.com>,
        Andi Kleen <ak@...ux.intel.com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        kernel-team@....com
Subject: Re: [PATCH 12/12] perf report: Add --task option to display
 monitored tasks

On Tue, Jan 09, 2018 at 10:05:24AM -0300, Arnaldo Carvalho de Melo wrote:
> Em Tue, Jan 09, 2018 at 10:15:51AM +0100, Jiri Olsa escreveu:
> > On Tue, Jan 09, 2018 at 10:56:07AM +0900, Namhyung Kim wrote:
> > 
> > SNIP
> > 
> > > > +static struct task *task_list(struct task *task, struct machine *machine)
> > > > +{
> > > > +	struct thread *parent_thread, *thread = task->thread;
> > > > +	struct task   *parent_task;
> > > > +
> > > > +	/* Already listed. */
> > > > +	if (!list_empty(&task->list))
> > > > +		return NULL;
> > > > +
> > > > +	/* Last one in the chain. */
> > > > +	if (thread->ppid == -1)
> > > > +		return task;
> > > > +
> > > > +	parent_thread = machine__findnew_thread(machine, -1, thread->ppid);
> > > 
> > > I think it should be machine__find_thread() since creating a new
> > > thread at this stage would lack thread->priv anyway.
> > 
> > ugh, that's right.. I tried to stay safe, but the NULL
> > in priv would bring it down anyway
> > 
> > Arnaldo,
> > I already see changed version on top of your branch,
> > please let me know if you make also this change or
> > I should send v2
> 
> I can make the change, thanks!
> 
> Just to make sure we're on the same page, just this, right?
> 
> diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
> index 3685ac101b16..e60709fe31ed 100644
> --- a/tools/perf/builtin-report.c
> +++ b/tools/perf/builtin-report.c
> @@ -633,9 +633,9 @@ static struct task *tasks_list(struct task *task, struct machine *machine)
>  	if (thread->ppid == -1)
>  		return task;
>  
> -	parent_thread = machine__findnew_thread(machine, -1, thread->ppid);
> +	parent_thread = machine__find_thread(machine, -1, thread->ppid);

yes

>  	if (!parent_thread)
> -		return ERR_PTR(-ENOMEM);
> +		return ERR_PTR(-ENOENT);

right, I haven't noticed this one.. then we should
also do in the attached change

thanks,
jirka


---
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index f7338b594844..67c74d6dab24 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -710,7 +710,7 @@ static int tasks_print(struct report *rep, FILE *fp)
 		if (IS_ERR(task)) {
 			pr_err("Error: failed to process tasks\n");
 			free(tasks);
-			return -ENOMEM;
+			return PTR_ERR(task);
 		}
 
 		if (task)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ