On Tue, May 20, 2025 at 01:07:28PM +0300, Ilpo Järvinen wrote: > On Tue, 20 May 2025, Shuai Xue wrote: > > , and the format of "Link Speed changed" is a bit different from > > "pci_hp_event". > > The difference is only because when the Link is down, there's no Link > Speed (obviously). Whenever a new device is hotplugged and it comes up, > there's also Link Speed for it which can be included into the trace event. > > I think the trace event should have some special value for the fields that > are N/A due to Link being off. While it would be possible to create > separate events for speed changes and hotplug, I don't see any pros in > that approach over just having the N/A fields marked as such when the Link > is Down.
Link speed changes and device plug/unplug events are orthogonal, I don't think they should be mixed together in the same event. A link speed event can be signaled simultaneously to a plug event and then user space can decide in which type of event it's interested in. That also avoids the awkwardness of having N/A values for the link speed on unplug. Thanks, Lukas