Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp401537lqh; Tue, 7 May 2024 02:43:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWbLxfdOuUtf/nHBpN/IXMFo0jVnBaHN+J02sWHY48LQZ/2pjJDbm+D1F2JZ8VN0hA4UEf/syFWXVN0QvD7hbPb0Nf0dPgMfLeTOCa8sQ== X-Google-Smtp-Source: AGHT+IHiZEnhBLM/KA+mm0oMb16WCYdpv4kGX5KE7BUDtP2uUaU+MPSAYbmvFKbTkdIC8RNS28DU X-Received: by 2002:a05:622a:4f:b0:43b:1561:6c41 with SMTP id y15-20020a05622a004f00b0043b15616c41mr16848852qtw.1.1715075022421; Tue, 07 May 2024 02:43:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715075022; cv=pass; d=google.com; s=arc-20160816; b=bXsi5E94x+hkEezIHmTRqQVOGZhLZvD75gNgMD1Sr/QQMj5gVctEi/w2bwPu303IC5 gK3TNF2AiWBAuVbzagOJeLr+Qak7qCBEx/G+TqU7ZOBG3YPjpWUtbRa1wlqxuDiJxnRo NaNjCp7L4/ONM7lBJXJUvVzwTDU4FTYdHY8AOq0akb1D+AGuty0v2dyMEeFMfPgvgaDm 7Kql+IjZQgeRzdcpW+wSdDiwwCLR4wJlDFulp1Ozx0k6hQ1P+1UTY9+i1/VRFNFCxNaI 0cXnX/iEW/NhNnSl/YhalGU8qD8mGlshhUZbFzNTH81sN12FzWAH7jl+bB78G6uRU0ln Hl1w== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=dz5BXU3UHX4CwUX1cfETvCcNBZ5e+2wWNg8Li1dCQhQ=; fh=Hf1sotRPqXS391m+VIxZYYUITh3VXRgsV2sdkTlDBqc=; b=dQhDOZBM3WCjCCyJfs4EgAkGVoPBBT654A1rbbTMZ58yfefQBcArw7XSIWhco1Ftm/ +d228zn8zdop95zEq4v8P/dqxzZFvgZspg25zl+6mAhqHCVPyQAOJvA9YZbySJ1cOaik zTs7lavEckccYB0DjpNcjxg5oRwuTKh/p2t+1IYahvzirD4ysPnQR9QtxBMGL9oGG5ze 9A+EbxSz7LtXySMzFUtPKg5XmzP4rhyT+FdoD2WGrQ0cCqY3dSmiZViEZ7gucAIkkymg R4zdZX/Lpd3Eb9ULdjFYxJMOLbLQDcy/Kj5/lJ+SpGIEmohtLetvZ0xzIY3yrOuRJWt0 ezgA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=A86JSHW1; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-170994-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170994-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id dj12-20020a05622a4e8c00b00439ac788934si10357303qtb.754.2024.05.07.02.43.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 02:43:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170994-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=A86JSHW1; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-170994-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170994-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 2BF551C219D4 for ; Tue, 7 May 2024 09:43:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C33BE16192D; Tue, 7 May 2024 09:36:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="A86JSHW1" Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A770115FD0D; Tue, 7 May 2024 09:36:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715074573; cv=none; b=RYRwwK0LaBT+1bPhFtaTbohdmZa5FwqHLpXv4oOzr3SfQYds0sgErhHJlcF4iyS8Gd61+8aEou/d1pVruE50DKtRC7AfuTGkQz1yOQdIWT6/mERJqq4VJOUPqvCOGTis8HUt9M7jPKnNrxP2dlbiYQREPkFSrcPWVtLevIW/f7w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715074573; c=relaxed/simple; bh=n9Lpi3xDswaRGuMexMLHv+Fr/pOl2uShyoPzAxM/LkI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=nrndFEXZSSR+JGRLW25RsjZRiQSrqjQfnfw9AQkYrCLkjKa7ql5T8YqTMaIhdhrb58khLHEiLgxeHNDhsfmG9Ot9b1ptjvRfjlFCJ0WNrJhkibGNbo2AObWV9yEE+7RqySQgICyHClhHAtAvS1FolUerA1Kt+AtAFQ0R0I1obPM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=A86JSHW1; arc=none smtp.client-ip=209.85.208.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-f174.google.com with SMTP id 38308e7fff4ca-2e242b1df60so34987121fa.1; Tue, 07 May 2024 02:36:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715074569; x=1715679369; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dz5BXU3UHX4CwUX1cfETvCcNBZ5e+2wWNg8Li1dCQhQ=; b=A86JSHW1fpMiKREDa7dcbuZtDYqKOdqw/m7nGl+T+JvvboNRIhnMPkHMx1KPON9Bgj HkS5QHjxTmHg1aIyQ+8KW/8EC6hS3soFF+ByDVFg//2XsTxrc8HWTAT5EQZy6grUvTHh dCYn32LRhGe8QzLV9pCNUZA+zYE5/BisL/zbwLpVZd+GqthWyLI+LWPm+y70HikjTFaS 0F7HimHjGVXOpitWRqwAXkbw7TnVc5ysbyQC7hINEfjfj2YFlyaVNUcTkuBxTg9yyNdk kscSkPs8E2JqTe2UWT0hET1upAY5ECYzCWZ6LfRTM8UgAbfmKllRzEUxNzgIMVk8kkF1 XhXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715074569; x=1715679369; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dz5BXU3UHX4CwUX1cfETvCcNBZ5e+2wWNg8Li1dCQhQ=; b=GzU4NUqRBuv7+srNFoyU6LqDSZY+DewL5IY6Ed0qefKXQjnir5PRoMcpY2e1sU7rG2 dojK5vPqhMfrysHByt0Ve/jA/oeiZ4ZralBrj9JuVjNhaOLPgmUS282Y7HV7jul8E5wt QXDcIcdJvIKwvQ+dA6s/dPDUl41LETfTXoiN0J03RLkf6WAHx6s/g5xQkaUiCe0rckxK nlKIeNQP9n9N3EQtLfCtuee4IKVS+BQAnD7rLQYN70RRxMVudM6Lnz92IuBxg1dK+wHj ajPtxxU113tv4Rmy/BtXL3ApqspQILh4Onqk71fJQcLpf3mbTFSLmRAUSncLj/XYGgTv ybag== X-Forwarded-Encrypted: i=1; AJvYcCUU51VaTy3KEqaZ8oh/Z3tM+Vd5q1uq0HCZJfK6F5i6P5Nf/64fNyivV8FWeJSxtbUUcGc4DVw+oXk5XQYhAtmRg61rxQUmfmw52wUK X-Gm-Message-State: AOJu0YwYM+/7htlQPC5sMDQxsGpR4/D3DcrcNnBX921EfZuwrR0avnHZ dtayZ5E9Alr6QScpzbxDnVbK77cLtQhv4WpYayZg1iaIMhfGvGqS X-Received: by 2002:a2e:9dd0:0:b0:2e2:6372:7747 with SMTP id x16-20020a2e9dd0000000b002e263727747mr10079058ljj.4.1715074568625; Tue, 07 May 2024 02:36:08 -0700 (PDT) Received: from pc638.lan (host-185-121-47-193.sydskane.nu. [185.121.47.193]) by smtp.gmail.com with ESMTPSA id t18-20020a2e9d12000000b002e29c50c4dcsm1335473lji.27.2024.05.07.02.36.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 02:36:08 -0700 (PDT) From: "Uladzislau Rezki (Sony)" To: "Paul E . McKenney" Cc: RCU , Neeraj upadhyay , Boqun Feng , Hillf Danton , Joel Fernandes , LKML , Uladzislau Rezki , Oleksiy Avramchenko , Frederic Weisbecker Subject: [PATCH 36/48] rcu: Add a trace event for synchronize_rcu_normal() Date: Tue, 7 May 2024 11:35:18 +0200 Message-Id: <20240507093530.3043-37-urezki@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240507093530.3043-1-urezki@gmail.com> References: <20240507093530.3043-1-urezki@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Add an rcu_sr_normal() trace event. It takes three arguments first one is the name of RCU flavour, second one is a user id which triggeres synchronize_rcu_normal() and last one is an event. There are two traces in the synchronize_rcu_normal(). On entry, when a new request is registered and on exit point when request is completed. Please note, CONFIG_RCU_TRACE=y is required to activate traces. Reviewed-by: Paul E. McKenney Signed-off-by: Uladzislau Rezki (Sony) --- include/trace/events/rcu.h | 27 +++++++++++++++++++++++++++ kernel/rcu/tree.c | 7 ++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/include/trace/events/rcu.h b/include/trace/events/rcu.h index 2ef9c719772a..31b3e0d3e65f 100644 --- a/include/trace/events/rcu.h +++ b/include/trace/events/rcu.h @@ -707,6 +707,33 @@ TRACE_EVENT_RCU(rcu_invoke_kfree_bulk_callback, __entry->rcuname, __entry->p, __entry->nr_records) ); +/* + * Tracepoint for a normal synchronize_rcu() states. The first argument + * is the RCU flavor, the second argument is a pointer to rcu_head the + * last one is an event. + */ +TRACE_EVENT_RCU(rcu_sr_normal, + + TP_PROTO(const char *rcuname, struct rcu_head *rhp, const char *srevent), + + TP_ARGS(rcuname, rhp, srevent), + + TP_STRUCT__entry( + __field(const char *, rcuname) + __field(void *, rhp) + __field(const char *, srevent) + ), + + TP_fast_assign( + __entry->rcuname = rcuname; + __entry->rhp = rhp; + __entry->srevent = srevent; + ), + + TP_printk("%s rhp=0x%p event=%s", + __entry->rcuname, __entry->rhp, __entry->srevent) +); + /* * Tracepoint for exiting rcu_do_batch after RCU callbacks have been * invoked. The first argument is the name of the RCU flavor, diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index f65255205e44..2e1c5be6d64b 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -3863,9 +3863,11 @@ static void synchronize_rcu_normal(void) { struct rcu_synchronize rs; + trace_rcu_sr_normal(rcu_state.name, &rs.head, TPS("request")); + if (!READ_ONCE(rcu_normal_wake_from_gp)) { wait_rcu_gp(call_rcu_hurry); - return; + goto trace_complete_out; } init_rcu_head_on_stack(&rs.head); @@ -3886,6 +3888,9 @@ static void synchronize_rcu_normal(void) /* Now we can wait. */ wait_for_completion(&rs.completion); destroy_rcu_head_on_stack(&rs.head); + +trace_complete_out: + trace_rcu_sr_normal(rcu_state.name, &rs.head, TPS("complete")); } /** -- 2.39.2