On Wed, May 21, 2025 at 10:46:42AM +0100, Jonathan Cameron wrote:
> On Tue, 20 May 2025 16:50:28 -0500
> Bjorn Helgaas <helg...@kernel.org> wrote:
> 
> > From: Bjorn Helgaas <bhelg...@google.com>
> > 
> > As with the AER statistics, we always want to emit trace events, even if
> > the actual dmesg logging is rate limited.
> > 
> > Call trace_aer_event() directly from pci_dev_aer_stats_incr(), where we
> > update the statistics.
> > 
> > Signed-off-by: Bjorn Helgaas <bhelg...@google.com>
> > Tested-by: Krzysztof Wilczyński <kwilczyn...@kernel.org>
> > Reviewed-by: Ilpo Järvinen <ilpo.jarvi...@linux.intel.com>
> > Reviewed-by: Kuppuswamy Sathyanarayanan 
> > <sathyanarayanan.kuppusw...@linux.intel.com>
> 
> Hmm. This runs a bit counter to what I liked in previous patch.
> Whilst convenient to issue trace points in the stats update function
> it's not obvious behavior given naming.  Maybe just duplicate the call
> and call it immediately after the pci_dev_aer_stats_incr() calls?

Good point, thanks.  I made this change, which also means we don't
need to copy the header log into "info" because we can just use
aer->header_log as before:

> > @@ -782,6 +782,9 @@ void pci_print_aer(struct pci_dev *dev, int 
> > aer_severity,
> >  
> >     info.status = status;
> >     info.mask = mask;
> > +   info.tlp_header_valid = tlp_header_valid;
> > +   if (tlp_header_valid)
> > +           info.tlp = aer->header_log;
> >  
> >     pci_dev_aer_stats_incr(dev, &info);
> >  
> > @@ -799,9 +802,6 @@ void pci_print_aer(struct pci_dev *dev, int 
> > aer_severity,
> >  
> >     if (tlp_header_valid)
> >             pcie_print_tlp_log(dev, &aer->header_log, dev_fmt("  "));
> > -
> > -   trace_aer_event(pci_name(dev), (status & ~mask),
> > -                   aer_severity, tlp_header_valid, &aer->header_log);
> >  }
> >  EXPORT_SYMBOL_NS_GPL(pci_print_aer, "CXL");
> >  
> 

Reply via email to