From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (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 EACD3BE49; Tue, 23 Sep 2025 07:34:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.20 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758612882; cv=none; b=OPiYWD/j+TJyb7Oznlzd/+ydYnVOixaZXxX/MptClqv1314PPSX2v6H4rXk8450d5KH9A2WNPE0cBq2yFgpNkPNSTpNICqCNHeFkrxi0a9GfGxjIF6RywskgY62lZIh+QeCgpihEllb4eRYrvUAk4VYf7vFyu1j2NNrcoJRsnA4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758612882; c=relaxed/simple; bh=KuImyqyKNN76OPYNcqBrprXaC7zThCBm0Z1hOVDDaFg=; h=From:Date:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=TqqFKATPOxci1EsTmbDdan0/TT8QPpCeWCml6+AUAyJU/HwxNXIkpqm5ZvH8YzW5wkdpIRu4wZ5pH4S+6BxND0r9vvE9OFpNkAmgt769Ytpx92Ji+XJ0YNvZrgDl93WPp7luEu8/y3rIJeSTMiqp4FjBdd5IDHLiHcBEusB9RWI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=DIXw5jTR; arc=none smtp.client-ip=198.175.65.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="DIXw5jTR" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1758612880; x=1790148880; h=from:date:to:cc:subject:in-reply-to:message-id: references:mime-version:content-id; bh=KuImyqyKNN76OPYNcqBrprXaC7zThCBm0Z1hOVDDaFg=; b=DIXw5jTRL8FAQIbyN7Zhg9quHJhKc7IrcOaVCwjyI4SxTULay3WK1q4S QNRljS5iwRRaKvC+reqWRm1JCSDYE4ReZAjpQswWnWBkSn9TXdQWSwFC1 XB8xZf9uHGj9zAV4HczD0p7zUXxE6QliYqt+Z3fh5Mf+9SZsE2yU9ZSjp WNac1KeXzWgr3TZzmG5ib5Zz/4Kh9Hi6eMnSH6zBji7XszZc7wSnlKSVl J/dsz5xSnkOo7XadX+1YbJtNsFQBivxpkje7Iar5zVFUdkNo0iOKEdCZO T5qZTW7xInQsrIYhr1CcjVXdVfZH4pcKmbhZqiDd2QzvjjkvYtL/R0Y8U w==; X-CSE-ConnectionGUID: oXa+NlGTQAGQvckYz9w4ZQ== X-CSE-MsgGUID: urY/hGcEShO8IoDGCfjfpg== X-IronPort-AV: E=McAfee;i="6800,10657,11561"; a="60585599" X-IronPort-AV: E=Sophos;i="6.18,287,1751266800"; d="scan'208";a="60585599" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2025 00:34:39 -0700 X-CSE-ConnectionGUID: glbmymB0TPa38tBYYPQl/A== X-CSE-MsgGUID: SCYVPC4tTMa1pbE4swgYsQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.18,287,1751266800"; d="scan'208";a="200394573" Received: from ijarvine-mobl1.ger.corp.intel.com (HELO localhost) ([10.245.244.234]) by fmviesa002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2025 00:34:12 -0700 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Date: Tue, 23 Sep 2025 10:34:08 +0300 (EEST) To: Shuai Xue cc: rostedt@goodmis.org, Lukas Wunner , linux-pci@vger.kernel.org, LKML , linux-edac@vger.kernel.org, linux-trace-kernel@vger.kernel.org, helgaas@kernel.org, mattc@purestorage.com, Jonathan.Cameron@huawei.com, bhelgaas@google.com, tony.luck@intel.com, bp@alien8.de, mhiramat@kernel.org, mathieu.desnoyers@efficios.com, oleg@redhat.com, naveen@kernel.org, davem@davemloft.net, anil.s.keshavamurthy@intel.com, mark.rutland@arm.com, peterz@infradead.org, tianruidong@linux.alibaba.com Subject: Re: [PATCH v10 1/3] PCI: trace: Add a generic RAS tracepoint for hotplug event In-Reply-To: Message-ID: <453b792a-23f9-6d72-f35a-60526b3e04e0@linux.intel.com> References: <20250920060117.866-1-xueshuai@linux.alibaba.com> <20250920060117.866-2-xueshuai@linux.alibaba.com> <6bab311a-d5ba-133c-fddd-52899959445c@linux.intel.com> <12c84bff-6863-4730-b08a-631df904aa12@linux.alibaba.com> Precedence: bulk X-Mailing-List: linux-edac@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323328-1382897340-1758612811=:961" Content-ID: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323328-1382897340-1758612811=:961 Content-Type: text/plain; CHARSET=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Content-ID: On Tue, 23 Sep 2025, Ilpo J=C3=A4rvinen wrote: > On Tue, 23 Sep 2025, Shuai Xue wrote: >=20 > >=20 > >=20 > > =E5=9C=A8 2025/9/23 14:46, Ilpo J=C3=A4rvinen =E5=86=99=E9=81=93: > > > On Tue, 23 Sep 2025, Shuai Xue wrote: > > >=20 > > > >=20 > > > >=20 > > > > =E5=9C=A8 2025/9/22 21:10, Ilpo J=C3=A4rvinen =E5=86=99=E9=81=93: > > > > > On Sat, 20 Sep 2025, Shuai Xue wrote: > > > > >=20 > > > > > > Hotplug events are critical indicators for analyzing hardware h= ealth, > > > > > > and surprise link downs can significantly impact system perform= ance > > > > > > and > > > > > > reliability. > > > > > >=20 > > > > > > Define a new TRACING_SYSTEM named "pci", add a generic RAS trac= epoint > > > > > > for hotplug event to help health checks. Add enum pci_hotplug_e= vent in > > > > > > include/uapi/linux/pci.h so applications like rasdaemon can reg= ister > > > > > > tracepoint event handlers for it. > > > > > >=20 > > > > > > The following output is generated when a device is hotplugged: > > > > > >=20 > > > > > > $ echo 1 > /sys/kernel/debug/tracing/events/pci/pci_hp_event/en= able > > > > > > $ cat /sys/kernel/debug/tracing/trace_pipe > > > > > > irq/51-pciehp-88 [001] ..... 1311.177459: pci_hp_eve= nt: > > > > > > 0000:00:02.0 slot:10, event:CARD_PRESENT > > > > > >=20 > > > > > > irq/51-pciehp-88 [001] ..... 1311.177566: pci_hp_eve= nt: > > > > > > 0000:00:02.0 slot:10, event:LINK_UP > > > > > >=20 > > > > > > Suggested-by: Lukas Wunner > > > > > > Suggested-by: Steven Rostedt > > > > > > Signed-off-by: Shuai Xue > > > > > > Reviewed-by: Lukas Wunner > > > > > > Reviewed-by: Jonathan Cameron > > > > > > --- > > > > > > drivers/pci/Makefile | 2 + > > > > > > drivers/pci/hotplug/Makefile | 3 +- > > > > > > drivers/pci/hotplug/pciehp_ctrl.c | 31 ++++++++++++--- > > > > > > drivers/pci/trace.c | 11 ++++++ > > > > > > include/trace/events/pci.h | 63 > > > > > > +++++++++++++++++++++++++++++++ > > > > > > include/uapi/linux/pci.h | 7 ++++ > > > > > > 6 files changed, 110 insertions(+), 7 deletions(-) > > > > > > create mode 100644 drivers/pci/trace.c > > > > > > create mode 100644 include/trace/events/pci.h > > > > > >=20 > > > > > > diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile > > > > > > index 67647f1880fb..bf389bc4dd3c 100644 > > > > > > --- a/drivers/pci/Makefile > > > > > > +++ b/drivers/pci/Makefile > > > > > > @@ -45,3 +45,5 @@ obj-y=09=09=09=09+=3D controller/ > > > > > > obj-y=09=09=09=09+=3D switch/ > > > > > > subdir-ccflags-$(CONFIG_PCI_DEBUG) :=3D -DDEBUG > > > > > > + > > > > > > +CFLAGS_trace.o :=3D -I$(src) > > > > > > diff --git a/drivers/pci/hotplug/Makefile > > > > > > b/drivers/pci/hotplug/Makefile > > > > > > index 40aaf31fe338..d41f7050b072 100644 > > > > > > --- a/drivers/pci/hotplug/Makefile > > > > > > +++ b/drivers/pci/hotplug/Makefile > > > > > > @@ -65,7 +65,8 @@ rpadlpar_io-objs=09:=3D=09rpadlpar_core.o \ > > > > > > pciehp-objs=09=09:=3D=09pciehp_core.o=09\ > > > > > > =09=09=09=09pciehp_ctrl.o=09\ > > > > > > =09=09=09=09pciehp_pci.o=09\ > > > > > > -=09=09=09=09pciehp_hpc.o > > > > > > +=09=09=09=09pciehp_hpc.o=09\ > > > > > > +=09=09=09=09../trace.o > > > > >=20 > > > > > To make it useful for any PCI tracing, not juse hotplug, this obj= ect > > > > > file > > > > > should be added in drivers/pci/Makefile, not here. > > > >=20 > > > > Make sence. How about adding to the main CONFIG_PCI object: > > > >=20 > > > > diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile > > > > index bf389bc4dd3c..d7f83d06351d 100644 > > > > --- a/drivers/pci/Makefile > > > > +++ b/drivers/pci/Makefile > > > > @@ -5,7 +5,7 @@ > > > > obj-$(CONFIG_PCI) +=3D access.o bus.o probe.o host-b= ridge.o \ > > > > remove.o pci.o pci-driver.o sea= rch.o \ > > > > rom.o setup-res.o irq.o vpd.o \ > > > > - setup-bus.o vc.o mmap.o devres.o > > > > + setup-bus.o vc.o mmap.o devres.o > > > > trace.o > > > >=20 > > > > obj-$(CONFIG_PCI) +=3D msi/ > > > > obj-$(CONFIG_PCI) +=3D pcie/ > > >=20 > > > Yes, that's the right place to add it. > > >=20 > >=20 > > Thanks for confirm. > > Will send a new version to fix it. >=20 > I actually now started to wonder if it should be made depend on some=20 > tracing related config (sending this out quickly if you were just=20 > waiting for my confirmation to send quickly... I'm still investigating > what other subsystems do). Probably this is what we actually want: obj-$(CONFIG_TRACING)=09=09=09+=3D trace.o --=20 i. --8323328-1382897340-1758612811=:961--