diff options
author | aiju <devnull@localhost> | 2018-12-13 10:42:49 +0000 |
---|---|---|
committer | aiju <devnull@localhost> | 2018-12-13 10:42:49 +0000 |
commit | c7304ea03caf68cf035d14f50f6e24e0c16ccdfe (patch) | |
tree | f4b5e8047078c41caa0d98cc0ea3d5012c4d17f9 /sys/include | |
parent | dae5a44111dfb21a714824a5cec2abee4f9f9080 (diff) |
dtracy: get rid of DTName struct, support more than three parts in a probe name, wildcard matching
Diffstat (limited to 'sys/include')
-rw-r--r-- | sys/include/dtracy.h | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/sys/include/dtracy.h b/sys/include/dtracy.h index cd8d577b3..438a8d1e7 100644 --- a/sys/include/dtracy.h +++ b/sys/include/dtracy.h @@ -18,7 +18,6 @@ enum { }; #define DTANIL ((u32int)-1) -typedef struct DTName DTName; typedef struct DTProbe DTProbe; typedef struct DTExprState DTExprState; typedef struct DTAct DTAct; @@ -32,12 +31,6 @@ typedef struct DTAgg DTAgg; typedef struct DTBuf DTBuf; typedef struct DTTrigInfo DTTrigInfo; -struct DTName { - char *provider; - char *function; - char *name; -}; - /* we assign all pairs (probe,action-group) (called an enabling or DTEnab) a unique ID called EPID. we could also use probe IDs and action group IDs but using a single 32-bit ID for both is more flexible/efficient. @@ -55,7 +48,7 @@ struct DTEnab { /* probes are never freed */ struct DTProbe { int nenable; - DTName; + char *name; DTEnab enablist; DTProvider *prov; void *aux; /* for the provider */ @@ -65,17 +58,16 @@ struct DTProbe { struct DTProvider { char *name; /* - provide() is called when the user asks for a probe that doesn't exist. + provide() is called when the user first uses a provider. provide() should call dtpnew() to create probes. - it can use the DTName as a hint or just create all probes that it knows about. - the provider has to ensure not to create the same probe multiple times. */ - void (*provide)(DTProvider *, DTName); + void (*provide)(DTProvider *); int (*enable)(DTProbe *); /* enable the probe. return >= 0 for success and < 0 for failure */ void (*disable)(DTProbe *); /* disable the probe */ /* for the library, not the provider */ DTProbe *probes; + int provided; }; /* @@ -246,8 +238,9 @@ void dtinit(int); void dtsync(void); /* probe functions */ -DTProbe *dtpnew(DTName, DTProvider *, void *aux); -int dtpmatch(DTName, DTProbe ***); +DTProbe *dtpnew(char *, DTProvider *, void *aux); +int dtpmatch(char *, DTProbe ***); +int dtplist(DTProbe ***); void dtptrigger(DTProbe *, int, DTTrigInfo *); /* expression functions */ @@ -269,7 +262,7 @@ void dtclfree(DTClause *); /* chan functions */ DTChan *dtcnew(void); void dtcfree(DTChan *); -int dtcaddgr(DTChan *, DTName, DTActGr *); +int dtcaddgr(DTChan *, char *, DTActGr *); int dtcaddcl(DTChan *, DTClause *); int dtcread(DTChan *, void *, int); int dtcaggread(DTChan *, void *, int); |