CVS commit: src/external/cddl/osnet/dev/profile
Module Name:src Committed By: ad Date: Fri May 15 23:57:17 UTC 2020 Modified Files: src/external/cddl/osnet/dev/profile: profile.c Log Message: Bump PROF_ARTIFICIAL_FRAMES to 4 now that cyclics are run from statclock(). To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/external/cddl/osnet/dev/profile/profile.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/dev/profile/profile.c diff -u src/external/cddl/osnet/dev/profile/profile.c:1.10 src/external/cddl/osnet/dev/profile/profile.c:1.11 --- src/external/cddl/osnet/dev/profile/profile.c:1.10 Fri Jun 29 11:33:46 2018 +++ src/external/cddl/osnet/dev/profile/profile.c Fri May 15 23:57:17 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: profile.c,v 1.10 2018/06/29 11:33:46 kamil Exp $ */ +/* $NetBSD: profile.c,v 1.11 2020/05/15 23:57:17 ad Exp $ */ /* * CDDL HEADER START @@ -169,7 +169,7 @@ struct profile_probe_percpu; #endif /* __FreeBSD__ */ #ifdef __NetBSD__ -#define PROF_ARTIFICIAL_FRAMES 3 +#define PROF_ARTIFICIAL_FRAMES 4 #endif typedef struct profile_probe {
CVS commit: src/external/cddl/osnet/dev/profile
Module Name:src Committed By: kamil Date: Wed Jun 6 17:19:49 UTC 2018 Modified Files: src/external/cddl/osnet/dev/profile: profile.c Log Message: Correct compilation of osnet/dev/profile/profile.c under Clang Constify char* types when initialized with liternals. This could be done with -W flags, but they are incompatible between compilers. This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build. Sponsored by To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/external/cddl/osnet/dev/profile/profile.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/dev/profile/profile.c diff -u src/external/cddl/osnet/dev/profile/profile.c:1.8 src/external/cddl/osnet/dev/profile/profile.c:1.9 --- src/external/cddl/osnet/dev/profile/profile.c:1.8 Mon May 28 21:05:03 2018 +++ src/external/cddl/osnet/dev/profile/profile.c Wed Jun 6 17:19:49 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: profile.c,v 1.8 2018/05/28 21:05:03 chs Exp $ */ +/* $NetBSD: profile.c,v 1.9 2018/06/06 17:19:49 kamil Exp $ */ /* * CDDL HEADER START @@ -434,7 +434,7 @@ profile_provide(void *arg, dtrace_probed char *name, *suffix = NULL; const struct { - char *prefix; + const char *prefix; int kind; } types[] = { { PROF_PREFIX_PROFILE, PROF_PROFILE }, @@ -443,7 +443,7 @@ profile_provide(void *arg, dtrace_probed }; const struct { - char *name; + const char *name; hrtime_t mult; } suffixes[] = { { "ns", NANOSEC / NANOSEC },
CVS commit: src/external/cddl/osnet/dev/profile
Module Name:src Committed By: riastradh Date: Sat Apr 9 15:17:58 UTC 2016 Modified Files: src/external/cddl/osnet/dev/profile: profile.c Log Message: Disable autoload if there are any profile probes. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/external/cddl/osnet/dev/profile/profile.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/dev/profile/profile.c diff -u src/external/cddl/osnet/dev/profile/profile.c:1.5 src/external/cddl/osnet/dev/profile/profile.c:1.6 --- src/external/cddl/osnet/dev/profile/profile.c:1.5 Mon Apr 4 05:15:07 2016 +++ src/external/cddl/osnet/dev/profile/profile.c Sat Apr 9 15:17:58 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: profile.c,v 1.5 2016/04/04 05:15:07 riastradh Exp $ */ +/* $NetBSD: profile.c,v 1.6 2016/04/09 15:17:58 riastradh Exp $ */ /* * CDDL HEADER START @@ -576,6 +576,11 @@ dtrace_profile_modcmd(modcmd_t cmd, void profile_unload(); return 0; + case MODULE_CMD_AUTOUNLOAD: + if (profile_total) + return EBUSY; + return 0; + default: return ENOTTY; }
CVS commit: src/external/cddl/osnet/dev/profile
Module Name:src Committed By: riastradh Date: Mon Apr 4 05:15:07 UTC 2016 Modified Files: src/external/cddl/osnet/dev/profile: profile.c Log Message: Fix module name of dtrace_profile. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/external/cddl/osnet/dev/profile/profile.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/dev/profile/profile.c diff -u src/external/cddl/osnet/dev/profile/profile.c:1.4 src/external/cddl/osnet/dev/profile/profile.c:1.5 --- src/external/cddl/osnet/dev/profile/profile.c:1.4 Fri Dec 7 03:11:17 2012 +++ src/external/cddl/osnet/dev/profile/profile.c Mon Apr 4 05:15:07 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: profile.c,v 1.4 2012/12/07 03:11:17 chs Exp $ */ +/* $NetBSD: profile.c,v 1.5 2016/04/04 05:15:07 riastradh Exp $ */ /* * CDDL HEADER START @@ -565,7 +565,7 @@ MODULE_DEPEND(profile, opensolaris, 1, 1 #ifdef __NetBSD__ static int -profile_modcmd(modcmd_t cmd, void *data) +dtrace_profile_modcmd(modcmd_t cmd, void *data) { switch (cmd) { case MODULE_CMD_INIT: @@ -581,6 +581,6 @@ profile_modcmd(modcmd_t cmd, void *data) } } -MODULE(MODULE_CLASS_MISC, profile, "dtrace,cyclic"); +MODULE(MODULE_CLASS_MISC, dtrace_profile, "dtrace,cyclic"); #endif
CVS commit: src/external/cddl/osnet/dev/profile
Module Name:src Committed By: chs Date: Fri Dec 7 03:11:17 UTC 2012 Modified Files: src/external/cddl/osnet/dev/profile: profile.c Log Message: adapt the profile dtrace provider to netbsd. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/cddl/osnet/dev/profile/profile.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/dev/profile/profile.c diff -u src/external/cddl/osnet/dev/profile/profile.c:1.3 src/external/cddl/osnet/dev/profile/profile.c:1.4 --- src/external/cddl/osnet/dev/profile/profile.c:1.3 Sun Jul 17 20:54:33 2011 +++ src/external/cddl/osnet/dev/profile/profile.c Fri Dec 7 03:11:17 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: profile.c,v 1.3 2011/07/17 20:54:33 joerg Exp $ */ +/* $NetBSD: profile.c,v 1.4 2012/12/07 03:11:17 chs Exp $ */ /* * CDDL HEADER START @@ -38,7 +38,9 @@ #include #include #include +#ifdef __FreeBSD__ #include +#endif #include #include #include @@ -51,10 +53,18 @@ #include #include #include +#ifdef __FreeBSD__ #include +#endif #include #include +#ifdef __NetBSD__ +#include +#include +#define ASSERT(x) KASSERT(x) +#endif + #include #include #include @@ -97,6 +107,7 @@ * and the static definition doesn't seem to be overly brittle. Still, we * allow for a manual override in case we get it completely wrong. */ +#ifdef __FreeBSD__ #ifdef __amd64 #define PROF_ARTIFICIAL_FRAMES 7 #else @@ -112,6 +123,11 @@ #endif #endif #endif +#endif + +#ifdef __NetBSD__ +#define PROF_ARTIFICIAL_FRAMES 3 +#endif typedef struct profile_probe { char prof_name[PROF_NAMELEN]; @@ -127,14 +143,16 @@ typedef struct profile_probe_percpu { profile_probe_t *profc_probe; } profile_probe_percpu_t; +#ifdef __FreeBSD__ static d_open_t profile_open; +#endif static int profile_unload(void); static void profile_create(hrtime_t, char *, int); static void profile_destroy(void *, dtrace_id_t, void *); -static void profile_enable(void *, dtrace_id_t, void *); +static int profile_enable(void *, dtrace_id_t, void *); static void profile_disable(void *, dtrace_id_t, void *); static void profile_load(void *); -static void profile_provide(void *, dtrace_probedesc_t *); +static void profile_provide(void *, const dtrace_probedesc_t *); static int profile_rates[] = { 97, 199, 499, 997, 1999, @@ -161,11 +179,13 @@ static uint32_t profile_max = PROFILE_MA /* maximum number of profile probes */ static uint32_t profile_total; /* current number of profile probes */ +#ifdef __FreeBSD__ static struct cdevsw profile_cdevsw = { .d_version = D_VERSION, .d_open = profile_open, .d_name = "profile", }; +#endif static dtrace_pattr_t profile_attr = { { DTRACE_STABILITY_EVOLVING, DTRACE_STABILITY_EVOLVING, DTRACE_CLASS_COMMON }, @@ -188,7 +208,9 @@ static dtrace_pops_t profile_pops = { profile_destroy }; +#ifdef __FreeBSD__ static struct cdev *profile_cdev; +#endif static dtrace_provider_id_t profile_id; static hrtime_t profile_interval_min = NANOSEC / 5000; /* 5000 hz */ static int profile_aframes = 0; /* override */ @@ -199,7 +221,7 @@ profile_fire(void *arg) profile_probe_percpu_t *pcpu = arg; profile_probe_t *prof = pcpu->profc_probe; hrtime_t late; - solaris_cpu_t *c = &solaris_cpu[curcpu]; + solaris_cpu_t *c = &solaris_cpu[cpu_number()]; late = gethrtime() - pcpu->profc_expected; pcpu->profc_expected += pcpu->profc_interval; @@ -212,7 +234,7 @@ static void profile_tick(void *arg) { profile_probe_t *prof = arg; - solaris_cpu_t *c = &solaris_cpu[curcpu]; + solaris_cpu_t *c = &solaris_cpu[cpu_number()]; dtrace_probe(prof->prof_id, c->cpu_profile_pc, c->cpu_profile_upc, 0, 0, 0); @@ -247,14 +269,14 @@ profile_create(hrtime_t interval, char * /*ARGSUSED*/ static void -profile_provide(void *arg, dtrace_probedesc_t *desc) +profile_provide(void *arg, const dtrace_probedesc_t *desc) { int i, j, rate, kind; hrtime_t val = 0, mult = 1, len = 0; char *name, *suffix = NULL; const struct { - char *prefix; + const char *prefix; int kind; } types[] = { { PROF_PREFIX_PROFILE, PROF_PROFILE }, @@ -263,7 +285,7 @@ profile_provide(void *arg, dtrace_probed }; const struct { - char *name; + const char *name; hrtime_t mult; } suffixes[] = { { "ns", NANOSEC / NANOSEC }, @@ -281,7 +303,7 @@ profile_provide(void *arg, dtrace_probed { "d", NANOSEC * (hrtime_t)(24 * 60 * 60) }, { "day", NANOSEC * (hrtime_t)(24 * 60 * 60) }, { "hz", 0 }, - { NULL } + { NULL, 0 } }; if (desc == NULL) { @@ -311,7 +333,7 @@ profile_provide(void *arg, dtrace_probed return; } - name = desc->dtpd_name; + name = (char *)desc->dtpd_name; for (i = 0; types[i].prefix != NULL; i++) { len = strlen(types[i].prefix); @@ -421,7 +443,7 @@ profile_offline(void *arg, cpu_t *cpu, v } /* ARGSUSED */ -static void +static int prof