version 1.13, 2015/08/20 14:40:18 |
version 1.13.16.1, 2018/07/28 04:37:57 |
Line 247 tprof_stop1(void) |
|
Line 247 tprof_stop1(void) |
|
workqueue_destroy(tprof_wq); |
workqueue_destroy(tprof_wq); |
} |
} |
|
|
|
static void |
|
tprof_getinfo(struct tprof_info *info) |
|
{ |
|
tprof_backend_t *tb; |
|
|
|
KASSERT(mutex_owned(&tprof_startstop_lock)); |
|
|
|
memset(info, 0, sizeof(*info)); |
|
info->ti_version = TPROF_VERSION; |
|
if ((tb = tprof_backend) != NULL) { |
|
info->ti_ident = tb->tb_ops->tbo_ident(); |
|
} |
|
} |
|
|
static int |
static int |
tprof_start(const struct tprof_param *param) |
tprof_start(const tprof_param_t *param) |
{ |
{ |
CPU_INFO_ITERATOR cii; |
CPU_INFO_ITERATOR cii; |
struct cpu_info *ci; |
struct cpu_info *ci; |
Line 296 tprof_start(const struct tprof_param *pa |
|
Line 310 tprof_start(const struct tprof_param *pa |
|
callout_setfunc(&c->c_callout, tprof_kick, ci); |
callout_setfunc(&c->c_callout, tprof_kick, ci); |
} |
} |
|
|
error = tb->tb_ops->tbo_start(NULL); |
error = tb->tb_ops->tbo_start(param); |
if (error != 0) { |
if (error != 0) { |
KASSERT(tb->tb_usecount > 0); |
KASSERT(tb->tb_usecount > 0); |
tb->tb_usecount--; |
tb->tb_usecount--; |
Line 404 tprof_backend_lookup(const char *name) |
|
Line 418 tprof_backend_lookup(const char *name) |
|
*/ |
*/ |
|
|
void |
void |
tprof_sample(tprof_backend_cookie_t *cookie, const tprof_frame_info_t *tfi) |
tprof_sample(void *unused, const tprof_frame_info_t *tfi) |
{ |
{ |
tprof_cpu_t * const c = tprof_curcpu(); |
tprof_cpu_t * const c = tprof_curcpu(); |
tprof_buf_t * const buf = c->c_buf; |
tprof_buf_t * const buf = c->c_buf; |
Line 608 tprof_read(dev_t dev, struct uio *uio, i |
|
Line 622 tprof_read(dev_t dev, struct uio *uio, i |
|
static int |
static int |
tprof_ioctl(dev_t dev, u_long cmd, void *data, int flags, struct lwp *l) |
tprof_ioctl(dev_t dev, u_long cmd, void *data, int flags, struct lwp *l) |
{ |
{ |
const struct tprof_param *param; |
const tprof_param_t *param; |
int error = 0; |
int error = 0; |
|
|
KASSERT(minor(dev) == 0); |
KASSERT(minor(dev) == 0); |
|
|
switch (cmd) { |
switch (cmd) { |
case TPROF_IOC_GETVERSION: |
case TPROF_IOC_GETINFO: |
*(int *)data = TPROF_VERSION; |
mutex_enter(&tprof_startstop_lock); |
|
tprof_getinfo(data); |
|
mutex_exit(&tprof_startstop_lock); |
break; |
break; |
case TPROF_IOC_START: |
case TPROF_IOC_START: |
param = data; |
param = data; |