Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754116AbYK0OXA (ORCPT ); Thu, 27 Nov 2008 09:23:00 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751995AbYK0OWd (ORCPT ); Thu, 27 Nov 2008 09:22:33 -0500 Received: from fg-out-1718.google.com ([72.14.220.152]:22734 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751740AbYK0OWb (ORCPT ); Thu, 27 Nov 2008 09:22:31 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:reply-to:to:subject:cc:in-reply-to :mime-version:content-type:content-transfer-encoding :content-disposition:references; b=MljktpRJBY9/bGuF+AA9wSiO3p/W+5j0baQAkJlQ1x+e2aNE5ejdluARp9rvQq9iPh fNHBGcLch/Fvy2oEcFq0+z+eJb/SFVTRZeYuk5CQAIpxu4umJJwoGIHxQCLQ6YRFjW1L 7JlnL8Rmq2JeprNcRRbBVp07bz9ZwqCLMbjTc= Message-ID: <7c86c4470811270622s540a17d8r73462dfa93d1bc6d@mail.gmail.com> Date: Thu, 27 Nov 2008 15:22:29 +0100 From: "stephane eranian" Reply-To: eranian@gmail.com To: "Ingo Molnar" Subject: Re: [patch 20/24] perfmon: system calls interface Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org, x86@kernel.org, andi@firstfloor.org, sfr@canb.auug.org.au, "Roland McGrath" , "Oleg Nesterov" In-Reply-To: <20081126140027.GC6562@elte.hu> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <492d0c0b.170e660a.15ba.ffffdabf@mx.google.com> <20081126140027.GC6562@elte.hu> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1499 Lines: 30 Ingo, On Wed, Nov 26, 2008 at 3:00 PM, Ingo Molnar wrote: > > Thirdly, the check for ->exit_state in pfm_task_incompatible() is not > needed: we've just passed ptrace_check_attach() so we know we just > transitioned the task to task->state == TASK_TRACED. > > If you _ever_ see a task exit TASK_TRACED and go zombie or dead from > there without this code allowing it that means the whole state machine > with ptrace is borked up by perfmon. For example i dont see where the > perfmon-control task parents itself as the exclusive debugger (parent) > of the debuggee-task. > Perfmon requires ptrace ONLY to stop the thread you want to operate on. For instance, to read the counters in a thread via pfm_read(), you need to have that thread stopped, so perfmon can extract the machine state safely. But when the monitored thread runs, it does not have to remain under the control of ptrace. All that is needed is that the thread is stopped while we are in the perfmon syscall. I think ptrace allows this today. We will be able to drop ptrace() once we switch to utrace in which case, the kernel will be able to easily stop the thread when entering the perfmon syscalls. I guess I don't quite understand the meaning of your last sentence. -- 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/