Re: [tip:perfcounters/core] perf_counter: Use PID namespaces properly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/02, tip-bot for Peter Zijlstra wrote:
>
> +static u32 perf_counter_pid(struct perf_counter *counter, struct task_struct *p)
> +{
> +	/*
> +	 * only top level counters have the pid namespace they were created in
> +	 */
> +	if (counter->parent)
> +		counter = counter->parent;
> +
> +	return task_tgid_nr_ns(p, counter->ns);
> +}
> +
> +static u32 perf_counter_tid(struct perf_counter *counter, struct task_struct *p)
> +{
> +	/*
> +	 * only top level counters have the pid namespace they were created in
> +	 */
> +	if (counter->parent)
> +		counter = counter->parent;
> +
> +	return task_pid_nr_ns(p, counter->ns);

Perhaps this should be

	return task_pid_nr_ns(p->group_leader);

?

> +		tid_entry.pid = perf_counter_pid(counter, current);
> +		tid_entry.tid = perf_counter_tid(counter, current);


Otherwise we seem to always report .pid == .tid

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux