From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E566519D075 for ; Mon, 26 Aug 2024 22:29:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724711400; cv=none; b=U3qmIgadhMCvVpDhJOH1w8vt7EdOLYOknEvo8YDGD8+qG95ltdguGBk5s/on2IuLBC40u2/YT3/g1CoEY7wst//BzzmGiYczgS4oKMScyKyPHeZL5iMBoWUZDmDXsXGr+/36OBX/ajg+NqUtRDYkHX4/AVDYFp25fVXmEOS7MyU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724711400; c=relaxed/simple; bh=HHniaaAUEh5qGDsKVQdFWKGpTLx/jtr723PMPK9bfAc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=TD2kHIOdwipTqufy7FTmKEZKJg8C8m5BrtNSnLyGJZa8uanTzngizNu8YD7sSUFZKmaUucfofLm95VwDwFG1qYZzjmqTAUxGD1aoKgzyiVfpWmDZdF2ZhXi/WZ5JmjWeUviBeEh+1IvGScv9JsQ/9Bn/yBPsYKgMs5uWXboWhGM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Pdt5xlTJ; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Pdt5xlTJ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724711397; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=k8lSeaX0Pdb7iUyeqcM9bZY3oSQ8CGTkXO2gXKHf45Q=; b=Pdt5xlTJhyvAVZnOQSzdYPm1ZmZBUbvBg72OTW1bICmNAOqJAyKHT4YSJXVmGIIaqSHpFX cchdiYp9qkqJHropp9iTgZthGhNN4/kGOSMRV3Qu9WuWcyvnI0bsJSatiCbUJR/uZR5UqG WzBhiqOJjfysiwQDmWZlCeMKJ2mwqfM= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-196-NbuyYXxMNqmLR9TCMx9Rwg-1; Mon, 26 Aug 2024 18:29:52 -0400 X-MC-Unique: NbuyYXxMNqmLR9TCMx9Rwg-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4C21519560A6; Mon, 26 Aug 2024 22:29:50 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.224.12]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id 5741219560A3; Mon, 26 Aug 2024 22:29:46 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Tue, 27 Aug 2024 00:29:43 +0200 (CEST) Date: Tue, 27 Aug 2024 00:29:38 +0200 From: Oleg Nesterov To: Jiri Olsa Cc: Tianyi Liu , andrii.nakryiko@gmail.com, mhiramat@kernel.org, ajor@meta.com, albancrequy@linux.microsoft.com, bpf@vger.kernel.org, flaniel@linux.microsoft.com, linux-trace-kernel@vger.kernel.org, linux@jordanrome.com, mathieu.desnoyers@efficios.com Subject: Re: [PATCH v2] tracing/uprobe: Add missing PID filter for uretprobe Message-ID: <20240826222938.GC30765@redhat.com> References: <20240825171417.GB3906@redhat.com> <20240825224018.GD3906@redhat.com> <20240826115752.GA21268@redhat.com> <20240826212552.GB30765@redhat.com> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 On 08/27, Jiri Olsa wrote: > > did you just bpftrace-ed bpftrace? ;-) on my setup I'm getting: > > [root@qemu ex]# ../bpftrace/build/src/bpftrace -e 'kprobe:uprobe_register { printf("%s\n", kstack); }' > Attaching 1 probe... > > uprobe_register+1 so I guess you are on tip/perf/core which killed uprobe_register_refctr() and changed bpf_uprobe_multi_link_attach() to use uprobe_register > bpf_uprobe_multi_link_attach+685 > __sys_bpf+9395 > __x64_sys_bpf+26 > do_syscall_64+128 > entry_SYSCALL_64_after_hwframe+118 > > > I'm not sure what's bpftrace version in fedora 40, I'm using upstream build: bpftrace v0.20.1 > [root@qemu ex]# ../bpftrace/build/src/bpftrace --info 2>&1 | grep uprobe_multi > uprobe_multi: yes Aha, I get uprobe_multi: no OK. So, on your setup bpftrace uses bpf_uprobe_multi_link_attach() and this implies ->ret_handler = uprobe_multi_link_ret_handler() which calls uprobe_prog_run() which does if (link->task && current->mm != link->task->mm) return 0; So, can you reproduce the problem reported by Tianyi on your setup? Oleg.