cam: Start adding dtrace provider 'cam'

Start to provide robust tracing in cam now that clang has broken my
fbt-based dtrace scripts a couple of times.

Sponsored by:		Netflix
Reviewed by:		adrian
Differential Revision:	https://reviews.freebsd.org/D54468
This commit is contained in:
Warner Losh
2026-01-07 23:19:03 -07:00
parent 3989a3d817
commit ecb1f46583
2 changed files with 19 additions and 0 deletions
+5
View File
@@ -30,9 +30,13 @@
#include <sys/param.h>
#ifdef _KERNEL
#include "opt_kdtrace.h"
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/memdesc.h>
#include <sys/queue.h>
#include <sys/sdt.h>
#include <sys/sysctl.h>
#else /* _KERNEL */
#include <stdlib.h>
@@ -55,6 +59,7 @@
FEATURE(scbus, "SCSI devices support");
SDT_PROVIDER_DEFINE(cam);
#endif
static int camstatusentrycomp(const void *key, const void *member);
+14
View File
@@ -33,6 +33,9 @@
#ifdef _KERNEL
#include "opt_cam.h"
/* Only need the hooks here so no opt_kdtrace.h */
#include <sys/queue.h>
#include <sys/sdt.h>
#endif
#ifndef _KERNEL
@@ -374,6 +377,17 @@ extern const struct cam_status_entry cam_status_table[];
extern const int num_cam_status_entries;
#ifdef _KERNEL
extern int cam_sort_io_queues;
#ifdef SDT_PROVIDER_DECLARE
SDT_PROVIDER_DECLARE(cam);
#endif
#define CAM_PROBE1(group, probe, arg0) \
SDT_PROBE1(cam, , group, probe, arg0)
#define CAM_PROBE2(group, probe, arg0, arg1) \
SDT_PROBE2(cam, , group, probe, arg0, arg1)
#define CAM_PROBE3(group, probe, arg0, arg1, arg2) \
SDT_PROBE3(cam, , group, probe, arg0, arg1, arg2)
#define CAM_PROBE4(group, probe, arg0, arg1, arg2, arg3) \
SDT_PROBE4(cam, , group, probe, arg0, arg1, arg2, arg3)
#endif
union ccb;
struct sbuf;