Message ID | 1375986471-27113-2-git-send-email-naveen.n.rao@linux.vnet.ibm.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
[ attempting to try out claws-mail, hopefully this messages isn't scrambled ;-) ] On Thu, 8 Aug 2013 23:57:49 +0530 "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> wrote: > Since we'll be adding multiple trace events to ras.h, we need to protect > each block appropriately so that they only get included in the right > places. Update PCIe AER trace event for this purpose. Why not make a separate file for each? You will have to define TRACE_EVENT_PCIE_AER for the users as well. That is, the places that include ras.h and use the trace_aer_*() tracepoints. > > Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> > --- > drivers/pci/pcie/aer/aerdrv_errprint.c | 1 + > include/trace/events/ras.h | 2 +- > 2 files changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/pci/pcie/aer/aerdrv_errprint.c b/drivers/pci/pcie/aer/aerdrv_errprint.c > index 2c7c9f5..4d06859 100644 > --- a/drivers/pci/pcie/aer/aerdrv_errprint.c > +++ b/drivers/pci/pcie/aer/aerdrv_errprint.c > @@ -24,6 +24,7 @@ > #include "aerdrv.h" > > #define CREATE_TRACE_POINTS > +#define TRACE_EVENT_PCIE_AER > #include <trace/events/ras.h> > > #define AER_AGENT_RECEIVER 0 > diff --git a/include/trace/events/ras.h b/include/trace/events/ras.h > index 88b8783..4a66142 100644 > --- a/include/trace/events/ras.h > +++ b/include/trace/events/ras.h > @@ -1,7 +1,7 @@ > #undef TRACE_SYSTEM > #define TRACE_SYSTEM ras > > -#if !defined(_TRACE_AER_H) || defined(TRACE_HEADER_MULTI_READ) > +#if (!defined(_TRACE_AER_H) || defined(TRACE_HEADER_MULTI_READ)) && defined() I think it would look cleaner to encapsulate the one define with the other: #ifdef TRACE_EVENT_PCIE_AER #if !defined(_TRACE_AER_H) || defined(TRACE_HEADER_MULTI_READ) -- Steve > #define _TRACE_AER_H > > #include <linux/tracepoint.h> -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 08/09/2013 12:53 AM, Steven Rostedt wrote: > [ attempting to try out claws-mail, hopefully this messages isn't > scrambled ;-) ] Works just fine :) > > On Thu, 8 Aug 2013 23:57:49 +0530 > "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> wrote: > >> Since we'll be adding multiple trace events to ras.h, we need to protect >> each block appropriately so that they only get included in the right >> places. Update PCIe AER trace event for this purpose. > > Why not make a separate file for each? You will have to define The idea was to have all RAS-related trace points in a single place. This was discussed back when the PCIe AER trace event was added and so I chose to add the new event here as well. > TRACE_EVENT_PCIE_AER for the users as well. That is, the places that > include ras.h and use the trace_aer_*() tracepoints. Do you mean the change I've done to aerdrv-errprint.c below? This trace point is currently only used there, so I guess we are ok? Thanks, Naveen > > >> >> Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> >> --- >> drivers/pci/pcie/aer/aerdrv_errprint.c | 1 + >> include/trace/events/ras.h | 2 +- >> 2 files changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/pci/pcie/aer/aerdrv_errprint.c b/drivers/pci/pcie/aer/aerdrv_errprint.c >> index 2c7c9f5..4d06859 100644 >> --- a/drivers/pci/pcie/aer/aerdrv_errprint.c >> +++ b/drivers/pci/pcie/aer/aerdrv_errprint.c >> @@ -24,6 +24,7 @@ >> #include "aerdrv.h" >> >> #define CREATE_TRACE_POINTS >> +#define TRACE_EVENT_PCIE_AER >> #include <trace/events/ras.h> >> >> #define AER_AGENT_RECEIVER 0 >> diff --git a/include/trace/events/ras.h b/include/trace/events/ras.h >> index 88b8783..4a66142 100644 >> --- a/include/trace/events/ras.h >> +++ b/include/trace/events/ras.h >> @@ -1,7 +1,7 @@ >> #undef TRACE_SYSTEM >> #define TRACE_SYSTEM ras >> >> -#if !defined(_TRACE_AER_H) || defined(TRACE_HEADER_MULTI_READ) >> +#if (!defined(_TRACE_AER_H) || defined(TRACE_HEADER_MULTI_READ)) && defined() > > I think it would look cleaner to encapsulate the one define with the > other: > > #ifdef TRACE_EVENT_PCIE_AER > #if !defined(_TRACE_AER_H) || defined(TRACE_HEADER_MULTI_READ) > > > -- Steve > >> #define _TRACE_AER_H >> >> #include <linux/tracepoint.h> > -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Mon, 12 Aug 2013 17:07:01 +0530 "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> wrote: > > TRACE_EVENT_PCIE_AER for the users as well. That is, the places that > > include ras.h and use the trace_aer_*() tracepoints. > > Do you mean the change I've done to aerdrv-errprint.c below? This trace > point is currently only used there, so I guess we are ok? > Yeah, if it's only used on one place, then it's fine. But if it gets used in other files, than those other files with have to define the macro as well. -- Steve -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Mon, Aug 12, 2013 at 09:13:37AM -0400, Steven Rostedt wrote: > Yeah, if it's only used on one place, then it's fine. But if it gets > used in other files, than those other files with have to define the > macro as well. Yeah, we need to be careful about this. When a ras tracepoint gets used in multiple places, I'm guessing it would be cleaner/easier to fork it out in its own ras-<a-lot-used-tracepoint>.h header, huh?
diff --git a/drivers/pci/pcie/aer/aerdrv_errprint.c b/drivers/pci/pcie/aer/aerdrv_errprint.c index 2c7c9f5..4d06859 100644 --- a/drivers/pci/pcie/aer/aerdrv_errprint.c +++ b/drivers/pci/pcie/aer/aerdrv_errprint.c @@ -24,6 +24,7 @@ #include "aerdrv.h" #define CREATE_TRACE_POINTS +#define TRACE_EVENT_PCIE_AER #include <trace/events/ras.h> #define AER_AGENT_RECEIVER 0 diff --git a/include/trace/events/ras.h b/include/trace/events/ras.h index 88b8783..4a66142 100644 --- a/include/trace/events/ras.h +++ b/include/trace/events/ras.h @@ -1,7 +1,7 @@ #undef TRACE_SYSTEM #define TRACE_SYSTEM ras -#if !defined(_TRACE_AER_H) || defined(TRACE_HEADER_MULTI_READ) +#if (!defined(_TRACE_AER_H) || defined(TRACE_HEADER_MULTI_READ)) && defined(TRACE_EVENT_PCIE_AER) #define _TRACE_AER_H #include <linux/tracepoint.h>
Since we'll be adding multiple trace events to ras.h, we need to protect each block appropriately so that they only get included in the right places. Update PCIe AER trace event for this purpose. Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> --- drivers/pci/pcie/aer/aerdrv_errprint.c | 1 + include/trace/events/ras.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)