Received: by 2002:ab2:3319:0:b0:1ef:7a0f:c32d with SMTP id i25csp716880lqc; Fri, 8 Mar 2024 09:34:58 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVVQ9SBziqgTLP4ngzi1mMwbHZgQVSihtPwvoWcYVbmgombZWoWZdzMs/S/eqE1/RZsf3sp3oHrd+UyAWinLfPaaLxaBEkoPeHLGlPwEg== X-Google-Smtp-Source: AGHT+IG8rsT63EfL2SgJTbMSOwmYZAx71bX+zN0i6hdi6K1l8GBAzpPy15LL6jiO+SfDcLB1Gsc2 X-Received: by 2002:a17:906:1d08:b0:a44:4610:6aad with SMTP id n8-20020a1709061d0800b00a4446106aadmr14129500ejh.11.1709919298171; Fri, 08 Mar 2024 09:34:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709919298; cv=pass; d=google.com; s=arc-20160816; b=HZ6RSi0Fhz2gajU72csMT6NwM6eNWFNyXzvJK7Y0UxuPeg8P0B2xaLN9yKNiyCENsO lBzLhfNGcoyCRrMNkFGWJpbN1NxL23aw/KzZ7/T+4BZlOJD1ToMT8wyDSFivuRdhoHgd kXXDXbt7MHT30IKBZS8Cc6yXpl34gMMjI0zlCkvNWfucUd71LFRYMpHr0DEmXKnU5o+i 6uLPp40VHw7x2F4gOJazOMpM5AGm0tR1NFniA2wk7ef2yu+i4FqcJFiDbPfWkovjcQmW W8eAuU9Ar1ibCZpptAyx6dYZrmyW4f6P0ebos9rr8Y3jKIgJDlZJa6ZjaCQVAVQyjaim A0uA== 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=C/cUkmoDb/vMEZdBp6an+/laLEoOrf8mMtp4dQwMC1s=; fh=iPb0wliV/+5GSPzDuFlpD+tyY13IxnUOIe7p4FeKQa0=; b=syRE/azdVU0ZXPBtBgRFiIdP/Q/tOwA/pi1KnqfuBUb27S1pe+QqdUeI9oWpqzdj9O Kk1IyMUsm2IllxWVhp+hir8paywoM7C6fCN8W9AlLAttXJinGNXYlzE2BwxdwI4NW/h6 8iq60XAO7W0lViwwegu4Qe532op8cwkP/wePGKgin3sC+6oJmvm7n71agygs7NEn/bkJ ukgz+aNsSjnO5Zo91ia90/dz76h6cttjjy8sqTLl7MCsgj6/UY3dVqLEQaf+BENOIlx3 Y+5y3SVKzjXeEpYcSo2/aOT7V71erAGx7yW2sAsDJyeVEG8sYhGJcSaH35WYUqgBUFa/ MwcA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="FZ/O0FuU"; 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-97396-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-97396-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id h21-20020a170906591500b00a3ec1463a12si3931ejq.348.2024.03.08.09.34.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 09:34:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-97396-linux.lists.archive=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=@gmail.com header.s=20230601 header.b="FZ/O0FuU"; 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-97396-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-97396-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 am.mirrors.kernel.org (Postfix) with ESMTPS id E06F31F222E4 for ; Fri, 8 Mar 2024 17:34:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EBB0F57335; Fri, 8 Mar 2024 17:34:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FZ/O0FuU" Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (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 56B6C3FBB9; Fri, 8 Mar 2024 17:34:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709919259; cv=none; b=qrpkgO7qEoQzqmV/aT3EWyU0wkbY+dU5b97fiKEVei0RTTJQ/Sefbl5QPKZ8qdnIMKm0Eu8CCvqslV8dRJPyb20VKsyQ9lrmBYCgTHEjI9s5QrZ5GoTsDFYPwIStS4vh6oE+VFWnvOQoqtFfMgoNCkdLNkDsWvbzo1QPZ71gIRU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709919259; c=relaxed/simple; bh=i9xh4PFq53VVHMU9LfrMaittt3a26iMVfWpygIZ7oew=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Q9LgwEuwlX0+/ZSzc7niKoHxkYr4HZz60ate8TNToHvesrV3GQ86vHuJZuT/w16XcayphvZs2nODrUeGPllbt3O6e9oQWCLTqq97IJUSn4J7VDJkbKE79ROq2FYsDhrolU6mUFThpJ0maOAewS/GqZeYRo2VfDvkNzBrjMMbOo8= 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=FZ/O0FuU; arc=none smtp.client-ip=209.85.167.52 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-lf1-f52.google.com with SMTP id 2adb3069b0e04-5132181d54bso3164987e87.3; Fri, 08 Mar 2024 09:34:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709919255; x=1710524055; 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=C/cUkmoDb/vMEZdBp6an+/laLEoOrf8mMtp4dQwMC1s=; b=FZ/O0FuU5oAzAxwhsFj6aiuBMmWC8dV75plF0OetUMKVUnZELCKbxHshZmuCwQ5hyZ YNKYme20UMEAy3mp0OWna9jd5yhqj1P7KhEQouRHd+na21yAo6Wp+KO1Y//dhEGTArL+ 2QNwkMCgPhFAloSSoG1GLp59iFmv5GryeFpBPbV/wLekOpNmI4k1V/RhxLBE5co0AtkK IzLPmKTCfSMfPFwy7kU0+JXv4SubhhGuY3iwq+oEgH14AIwv2Uoyu2wqr5JawNhn0FC4 i7h+FaeSWgBiEU4Jvz8R04a258n2JHqWQA8e/hq4Kkfb4Ul/NTSgsSc8KUlZP9EPuT3M WJCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709919255; x=1710524055; 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=C/cUkmoDb/vMEZdBp6an+/laLEoOrf8mMtp4dQwMC1s=; b=pFOkKG5d5XB/8ytb0iTlW2gTOWDzwsnwuxizWegdp2ndOmCp6CPKOOdySkiyKZVenL Rr36xBn8q6JB6pU/aYFXoThNb+8ZQZW2i9fgo7Lg+QOHB9+idhT1+ubBetsRHPkgKvXR +jBSVii7qrPmMEKBuMwOeUpqpUs+OHzO7d14MC5+hQSm82sD8zQHYimPCYZPYQUpTXZJ fEMfUzTG4Rd7qTiFh8TWVTWf9rE6wMZRDtlTnG06BE4+HwNaNcU3SA1++B17n6f8+bj/ lUQTDWa8p3dj6f+iRyOKh8lM+XUSpH79z6XAfL1jfj8wjPCbdS07RBVLPLFkqHgU6w6M +x2Q== X-Forwarded-Encrypted: i=1; AJvYcCXyiFxtSesl8Fkpkj0lFcq5HMPieKPYYtv2dks0R7cR7npgjDjRZQScWePytgocReftWrdcID5zUpt2UN6BdmGZqgfpkTvxBe40Sdqa X-Gm-Message-State: AOJu0YwXKLRFqRaxjSZwh9LRLW606kjvpGDMJCUwx5Y1VO2/deJ7CWz6 ByFLagLKC3byo23hOzGNtYvUTiTw95ZIkAk7co2bxIycflssi617 X-Received: by 2002:a19:c20c:0:b0:512:bb47:967c with SMTP id l12-20020a19c20c000000b00512bb47967cmr3382421lfc.19.1709919255167; Fri, 08 Mar 2024 09:34:15 -0800 (PST) Received: from pc638.lan (host-185-121-47-193.sydskane.nu. [185.121.47.193]) by smtp.gmail.com with ESMTPSA id a23-20020a195f57000000b0051333e2f55dsm3150504lfj.159.2024.03.08.09.34.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 09:34:14 -0800 (PST) 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 v6 3/6] rcu: Add a trace event for synchronize_rcu_normal() Date: Fri, 8 Mar 2024 18:34:06 +0100 Message-Id: <20240308173409.335345-4-urezki@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240308173409.335345-1-urezki@gmail.com> References: <20240308173409.335345-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. 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 42a31d4d279b..dcc1764e8fad 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -3887,9 +3887,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); @@ -3910,6 +3912,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