From patchwork Mon Feb 26 03:59:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Masami Hiramatsu (Google)" X-Patchwork-Id: 206235 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1860430dyb; Sun, 25 Feb 2024 20:14:09 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXOaJS95ZRBpQSnPU8lhfhx8mYBjy+6XI+Qnzn13urLBVaKcKlRQJsMSmj7+QtQtSSotwfYR8ljL26JY+SqdvPQ+MoJyw== X-Google-Smtp-Source: AGHT+IE57q2F1PyqT3KPTuqZscH5KL6PD1Co8hnf4+Lz9a/VWb+2ox325DdgBZ5UQUkbuPMQqDXe X-Received: by 2002:a17:906:354b:b0:a43:6f6:e23d with SMTP id s11-20020a170906354b00b00a4306f6e23dmr2290066eja.38.1708920849466; Sun, 25 Feb 2024 20:14:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708920849; cv=pass; d=google.com; s=arc-20160816; b=Hj7Kzta1rE5xsu/XPyDRLMOKSVcuZvVvM/8DTwvU+nIU4xC3XB1/eMKC2iea2B2rZW eq79X8jIPwpCwfJX8kLIW+3fRBxFNm0/E810e+5ECG8+TZ6gZjZv+VwHZgzuwTNZm59N Y7aosu2R6SnEM+xeAWwalGJKhyUKAOWQM177avZ2ARF5enEQ4nYLJU3meZrLT8PSQYSo zxeOKOnaSZfafWtNT4b757cO4ZZ8lo/WLYuoNiTDVAFp77MlqcLX3WTFt4rVzI79TZRR RTz7tv6Vkg5NQiOKeQZYXCuC5PN2iPbsqpPAXpz6E9jP+h8xL0U9zoD8/eC7kc9Qo312 Hz3Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:user-agent:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=kfB55lZMUHNqzfFE3k8m9X32PTjd+gL45+Sji83FHw4=; fh=+uEoxECwu+GZPXA+yzsV/ZJCsf7WyFzcH+9RxOmv8OU=; b=z9BltS/pGslZktVZm2hx+UNXlbSrnUTVh0uGQMuywJJyyNK/WG0zIKLJuWpTb6Tifb QyWcU0C3U3Bb3oJV9NPMM0LjjaMW44Eeu4LaQC/4xuuiCN/RXHw3BLsLozXOMcVBCVt5 Aptdw8i3aOf7NzJns3hh2qJYIj1wk5HjDr5kdgYpdMgnyb9bhT+jt2gp6qFSnJEmRHN7 L4RSmvISp78WGvExA4cGJSiFhJ4RbaYNFK2FAxT9YQZbx2YBxokoPLRq43bGiDCKr/AJ v2tPZcb9nReybpdeTPJlelvd182gJke4wgUgQesKCDjl4e4fsXffLdiFxWz4a57IUcVf D88Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="hbazXW/n"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-80510-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80510-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id h11-20020a170906398b00b00a381de492a6si1802256eje.969.2024.02.25.20.14.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 20:14:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80510-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="hbazXW/n"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-80510-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80510-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 364031F262B6 for ; Mon, 26 Feb 2024 04:04:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 05F951CD28; Mon, 26 Feb 2024 03:59:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hbazXW/n" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 6593D1CA85; Mon, 26 Feb 2024 03:59:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708919948; cv=none; b=dKMmmJQnXDs59hzEghivmf2c9gTbDuYAtXjZmIxit9LZ6Y5Vb5UsgO4F713dR1dZIrunJHsGo18HTvWQy98XnroYHk111GA4+y5ShJneIv3JtlHb0InXTm0cNtI6UQxC2uxe6b5Lag1JtCV1udy4s6d498nJ5bXhi6R50iveX3E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708919948; c=relaxed/simple; bh=+bUIR3Sr3KLkcoy88QRFGtdrGix9yzfmI6AvbnJxv5c=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=Sg5/cTNYSQAIkGARZmNXS7LC7phiIGCQ73XSPK9+fHtZNr9f1aPzLydTSlcNGMfb29dNH86Kp+J2WzHhS8Lphc9BEEhcLQOy4G6SH+0K2Ln5wJspv17NSxr7kmhyHbv61zzgISnIXpzOKPO4axav/b2KPK34TPuuY4F/lOQWTOU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hbazXW/n; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26456C433F1; Mon, 26 Feb 2024 03:59:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708919947; bh=+bUIR3Sr3KLkcoy88QRFGtdrGix9yzfmI6AvbnJxv5c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hbazXW/nYFyjtKHvoC+N5XOy84OIILjSUms/qyKqD3pgrhQb323DtqyYbVjIj80qH zFhwQu/yijQ17SmtTzGC2nSFVhCG/EvRgzsBIUlw1CQnrjnatKGo/0Mq/Rl94mNjTw uV37Fl4NXDg7EbYeIUPFVYHz4fcJZ/J0lJFwX1eVlj+gwpnhY0Kl1opVGZEUVdkHDg 3V1e1w9mhWcc7Ax8IT9cl4M1xqbVdw7JQCrj7D97WOcWWpFbs1GU4ziKKX3oMeBMVC qrcalUf/Bx8GCwXl5m9dShcL9JEXJZhd5kDei5sNpwYFnbiIzootb+35alNXp4kAyh AFZRrA13v0Nsw== From: "Masami Hiramatsu (Google)" To: Steven Rostedt , Jiri Olsa Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, mhiramat@kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v2 7/7] Documentation: tracing: Add entry argument access at function exit Date: Mon, 26 Feb 2024 12:59:03 +0900 Message-Id: <170891994330.609861.9109792572425248438.stgit@devnote2> X-Mailer: git-send-email 2.34.1 In-Reply-To: <170891987362.609861.6767830614537418260.stgit@devnote2> References: <170891987362.609861.6767830614537418260.stgit@devnote2> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791933388772448064 X-GMAIL-MSGID: 1791933388772448064 From: Masami Hiramatsu (Google) Add a notes about the entry argument access at function exit probes for kprobes and fprobe trace event. Signed-off-by: Masami Hiramatsu (Google) --- Documentation/trace/fprobetrace.rst | 7 +++++++ Documentation/trace/kprobetrace.rst | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/Documentation/trace/fprobetrace.rst b/Documentation/trace/fprobetrace.rst index e35e6b18df40..ab71ebf178cb 100644 --- a/Documentation/trace/fprobetrace.rst +++ b/Documentation/trace/fprobetrace.rst @@ -70,6 +70,13 @@ Synopsis of fprobe-events For the details of TYPE, see :ref:`kprobetrace documentation `. +Function arguments at exit +-------------------------- +Function arguments can be accessed at exit probe using $arg fetcharg. This +is useful to record the function parameter and return value at once, and +trace the difference of structure fields (for debuging a function whether it +correctly updates the given data structure or not) + BTF arguments ------------- BTF (BPF Type Format) argument allows user to trace function and tracepoint diff --git a/Documentation/trace/kprobetrace.rst b/Documentation/trace/kprobetrace.rst index bf9cecb69fc9..35a383f95746 100644 --- a/Documentation/trace/kprobetrace.rst +++ b/Documentation/trace/kprobetrace.rst @@ -70,6 +70,13 @@ Synopsis of kprobe_events (\*3) this is useful for fetching a field of data structures. (\*4) "u" means user-space dereference. See :ref:`user_mem_access`. +Function arguments at kretprobe +------------------------------- +Function arguments can be accessed at kretprobe using $arg fetcharg. This +is useful to record the function parameter and return value at once, and +trace the difference of structure fields (for debuging a function whether it +correctly updates the given data structure or not) + .. _kprobetrace_types: Types