+/*
+ * Objects of this class will trace a filtered interval for their lifetime.
+ * The constructor takes in the start tracepoint's arguments.
+ * By default, the end tracepoint emits no additional arguments,
+ * but you can set them with setEndCodes.
+ * Alternatively, you can set them individually with setA...setD
+ */
+class IOTimeStampIntervalConstantFiltered
+{
+public:
+ IOTimeStampIntervalConstantFiltered(unsigned int csc,
+ uintptr_t arg1 = 0, uintptr_t arg2 = 0,
+ uintptr_t arg3 = 0, uintptr_t arg4 = 0)
+ : _csc(csc), _endArg1(0), _endArg2(0), _endArg3(0), _endArg4(0)
+ {
+ (void)csc;
+ (void)arg1;
+ (void)arg2;
+ (void)arg3;
+ (void)arg4;
+ KDBG_FILTERED(((uint32_t)csc) | DBG_FUNC_START, arg1, arg2, arg3, arg4);
+ }
+ // Setters for the end debug codes
+ void
+ setEndCodes(uintptr_t arg1 = 0, uintptr_t arg2 = 0,
+ uintptr_t arg3 = 0, uintptr_t arg4 = 0)
+ {
+ _endArg1 = arg1;
+ _endArg2 = arg2;
+ _endArg3 = arg3;
+ _endArg4 = arg4;
+ }
+ void
+ setEndArg1(uintptr_t arg)
+ {
+ _endArg1 = arg;
+ }
+ void
+ setEndArg2(uintptr_t arg)
+ {
+ _endArg2 = arg;
+ }
+ void
+ setEndArg3(uintptr_t arg)
+ {
+ _endArg3 = arg;
+ }
+ void
+ setEndArg4(uintptr_t arg)
+ {
+ _endArg4 = arg;
+ }
+ ~IOTimeStampIntervalConstantFiltered()
+ {
+ KDBG_FILTERED(((uint32_t)_csc) | DBG_FUNC_END, _endArg1, _endArg2, _endArg3, _endArg4);
+ }
+private:
+#if (KDEBUG_LEVEL < KDEBUG_LEVEL_STANDARD)
+ __unused
+#endif /* KDEBUG_LEVEL < KDEBUG_LEVEL_STANDARD */
+ unsigned int _csc;
+ // End debug codes
+#if (KDEBUG_LEVEL < KDEBUG_LEVEL_STANDARD)
+ __unused
+#endif /* KDEBUG_LEVEL < KDEBUG_LEVEL_STANDARD */
+ uintptr_t _endArg1, _endArg2, _endArg3, _endArg4;
+};
+