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.129.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 17CB02C80 for ; Fri, 13 Sep 2024 11:52:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726228374; cv=none; b=jRijOR4vMx6WEtbGsXEkPt2OB0zAMuJgb71aPfx3sPrOQzjPVnz6c+pxQlokANf3ZwmMzeone72kmjDyGJTJmfdP8Bb6b5AqCP1V3L8S5Schoa2Kx5GXtQ/a2KCwDfOQbV3j7GU5lzOH7o69rjhfOADXmhNwVnMiltptFP7+Z7M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726228374; c=relaxed/simple; bh=pMCipnQS2GEzxtn5f/uJ+jzhSgUq2j2uXgI3jBB5eCI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bI/IK9GaZdEnQA/fDSoQpEXm/NrB9Z1EBP17vFb5ZaEoJGIJ41Mo1sZnFUIoFj00/gZCnvnqKntEeV3PS74TQKdw1aNmKOqbICbTg+up4sy9L1KxTCEZR+hYTi9gC6XDsaLipw4ejrL8ng3xgZfYHp+11z2oq4YdosfAikR+Sxw= 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=UgjXjzsr; arc=none smtp.client-ip=170.10.129.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="UgjXjzsr" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1726228372; 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=kjWhGkYRLL4AoRfx/SSMTKGWIse43z4bAnG3BFGqR34=; b=UgjXjzsrfop/G1JH1DpLAbQ75jdv1lBj43J22C4O4twZIyxf81UjWZXMgJhuUPPRonAaSa kPOS1tO76HauRN8K+BhZPbGyCNQOqnkcbRP8CdIbZUDt7yz+XWcUFdRu/j8lbp2a2a6XRP T1b7/VRpIkfBNIfSO2aCT1wprqp1HiY= 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-549-rBokVC_iPJ6RNTN59bqzpw-1; Fri, 13 Sep 2024 07:52:50 -0400 X-MC-Unique: rBokVC_iPJ6RNTN59bqzpw-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 995611955F07; Fri, 13 Sep 2024 11:52:47 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.226.25]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id 9F46519560AB; Fri, 13 Sep 2024 11:52:41 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Fri, 13 Sep 2024 13:52:35 +0200 (CEST) Date: Fri, 13 Sep 2024 13:52:28 +0200 From: Oleg Nesterov To: Jiri Olsa Cc: Peter Zijlstra , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , bpf@vger.kernel.org, Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Steven Rostedt , Masami Hiramatsu , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: Re: [PATCHv3 1/7] uprobe: Add support for session consumer Message-ID: <20240913115228.GE19305@redhat.com> References: <20240909074554.2339984-1-jolsa@kernel.org> <20240909074554.2339984-2-jolsa@kernel.org> Precedence: bulk X-Mailing-List: linux-trace-kernel@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: <20240909074554.2339984-2-jolsa@kernel.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 On 09/09, Jiri Olsa wrote: > > @@ -37,13 +37,16 @@ struct uprobe_consumer { > * for the current process. If filter() is omitted or returns true, > * UPROBE_HANDLER_REMOVE is effectively ignored. > */ > - int (*handler)(struct uprobe_consumer *self, struct pt_regs *regs); > + int (*handler)(struct uprobe_consumer *self, struct pt_regs *regs, __u64 *data); > int (*ret_handler)(struct uprobe_consumer *self, > unsigned long func, > - struct pt_regs *regs); > + struct pt_regs *regs, __u64 *data); And... I won't insist, but I'd suggest to do this in a separate patch which should also update the current users in bpf_trace.c, trace_uprobe.c and bpf_testmod.c. Then it would be easier to review the next "functional" change. But this is minor, feel free to ignore. Finally, imo this documentation in handler_chain() /* * The handler can return following values: * 0 - execute ret_handler (if it's defined) * 1 - remove uprobe * 2 - do nothing (ignore ret_handler) */ should be moved to uprobes.h and explain UPROBE_HANDLER_REMOVE/IGNORE there. And note that "remove uprobe" is misleading, it should say something like "remove the breakpoint from current->mm". Oleg.