Skip to content
Browse files

Remove redundant probes that are already provided by fbt.

  • Loading branch information...
1 parent 4c79402 commit 15b3d0acb297962135f9af5b526ee93b0a9d4b5b @pgj committed Aug 13, 2012
View
67 packages/mirage-platform/dtrace/generic.d
@@ -2,26 +2,21 @@
#pragma D option quiet
-mirage:kernel:kthread:entry
+fbt:mirage:mirage_kthread_body:entry
{
printf("-> %s()\n", probefunc);
}
-mirage:kernel:kthread:return
+fbt:kernel:kthread_exit:entry
{
- printf("<- %s()\n", probefunc);
+ printf("<- mirage_kthread_body()\n");
}
-mirage:kernel:caml_startup:start
+fbt:mirage:caml_startup:entry
{
printf("kernel thread activated, caml run-time starts\n");
}
-mirage:kernel:caml_startup:finish
-{
- printf("caml run-time finished\n");
-}
-
mirage:kernel:kthread_loop:start
{
printf("main function found, kicking off the main loop\n");
@@ -32,59 +27,7 @@ mirage:kernel:kthread_loop:stop
printf("main loop exited: (%d,%d)\n", arg0, arg1);
}
-mirage:kernel:kthread_init:entry
-{
- printf("-> mirage_kthread_init()\n");
-}
-
-mirage:kernel:kthread_init:return
-{
- printf("<- mirage_kthread_init()\n");
-}
-
-mirage:kernel:kthread_deinit:entry
-{
- printf("-> mirage_kthread_deinit()\n");
-}
-
-mirage:kernel:kthread_deinit:return
-{
- printf("<- mirage_kthread_deinit()\n");
-}
-
-mirage:kernel:kthread_launch:entry
-{
- printf("-> mirage_kthread_launch()\n");
-}
-
-mirage:kernel:kthread_launch:return
-{
- printf("<- mirage_kthread_launch()\n");
-}
-
-mirage:kernel:block_kernel:entry
+mirage:kernel:block:timeout
{
printf("blocking kernel for %d us\n", arg0);
}
-
-mirage:kernel:block_kernel:return {}
-
-mirage:kernel:alloc_pages:entry
-{
- printf("-> %s(%d)\n", probefunc, arg0);
-}
-
-mirage:kernel:alloc_pages:return
-{
- printf("<- %s()\n", probefunc);
-}
-
-mirage:kernel:io_page:contigmalloc
-{
- printf("%p = %s:%s(%d)\n", arg1, probeprov,probefunc, arg0);
-}
-
-mirage:kernel:io_page:contigfree
-{
- printf("%s:%s(%p,%d)\n", probeprov, probefunc, arg0, arg1);
-}
View
15 packages/mirage-platform/dtrace/io_page.d
@@ -4,15 +4,20 @@
mirage:kernel:io_page:refcount
{
- printf("%s:%s(%p,%d)\n", probefunc,probename, arg0, arg1);
+ printf("%s:%s(%p,%d)\n", probefunc, probename, args[0], args[1]);
}
-mirage:kernel:io_page:contigmalloc
+fbt:kernel:contigmalloc:entry
{
- printf("%s:%s(%p,%d)\n", probefunc,probename, arg1, arg0);
+ printf("%s:%s(%d)\n", probefunc, probename, args[0]);
}
-mirage:kernel:io_page:contigfree
+fbt:kernel:contigmalloc:return
{
- printf("%s:%s(%p,%d)\n", probefunc, probename, arg0, arg1);
+ printf("%s:%s = %p\n", probefunc, probename, args[0]);
+}
+
+fbt:kernel:contigfree:entry
+{
+ printf("%s:%s(%p,%d)\n", probefunc, probename, args[0], args[1]);
}
View
29 packages/mirage-platform/runtime/kernel/kmod.c
@@ -54,22 +54,10 @@ static char* argv[] = { "mirage", NULL };
MALLOC_DEFINE(M_MIRAGE, "mirage", "Mirage run-time");
SDT_PROVIDER_DEFINE(mirage);
-SDT_PROBE_DEFINE(mirage, kernel, kthread, entry, entry);
-SDT_PROBE_DEFINE(mirage, kernel, kthread, return, return);
-SDT_PROBE_DEFINE(mirage, kernel, caml_startup, start, start);
-SDT_PROBE_DEFINE(mirage, kernel, caml_startup, finish, finish);
-SDT_PROBE_DEFINE(mirage, kernel, kthread_init, entry, entry);
-SDT_PROBE_DEFINE(mirage, kernel, kthread_init, return, return);
-SDT_PROBE_ARGTYPE(mirage, kernel, kthread_init, return, 0, "int");
-SDT_PROBE_DEFINE(mirage, kernel, kthread_deinit, entry, entry);
-SDT_PROBE_DEFINE(mirage, kernel, kthread_deinit, return, return);
SDT_PROBE_DEFINE(mirage, kernel, kthread_loop, start, start);
SDT_PROBE_DEFINE(mirage, kernel, kthread_loop, stop, stop);
-SDT_PROBE_DEFINE(mirage, kernel, kthread_launch, entry, entry);
-SDT_PROBE_DEFINE(mirage, kernel, kthread_launch, return, return);
-SDT_PROBE_DEFINE(mirage, kernel, block_kernel, entry, entry);
-SDT_PROBE_ARGTYPE(mirage, kernel, block_kernel, entry, 0, "int");
-SDT_PROBE_DEFINE(mirage, kernel, block_kernel, return, return);
+SDT_PROBE_DEFINE(mirage, kernel, block, timeout, timeout);
+SDT_PROBE_ARGTYPE(mirage, kernel, block, timeout, 0, "int");
static SYSCTL_NODE(_kern, OID_AUTO, mirage, CTLFLAG_RD, NULL, "mirage");
@@ -90,10 +78,7 @@ mirage_kthread_body(void *arg __unused)
int caml_completed = 0;
mirage_kthread_state = THR_RUNNING;
- SDT_PROBE(mirage, kernel, kthread, entry, 0, 0, 0, 0, 0);
- SDT_PROBE(mirage, kernel, caml_startup, start, 0, 0, 0, 0, 0);
caml_startup(argv);
- SDT_PROBE(mirage, kernel, caml_startup, finish, 0, 0, 0, 0, 0);
v_main = caml_named_value("OS.Main.run");
if (v_main == NULL) {
@@ -112,7 +97,6 @@ mirage_kthread_body(void *arg __unused)
if (mirage_kthread_state == THR_STOPPED)
wakeup(&mirage_kthread_state);
mirage_kthread_state = THR_NONE;
- SDT_PROBE(mirage, kernel, kthread, return, 0, 0, 0, 0, 0);
kthread_exit();
}
@@ -121,7 +105,6 @@ mirage_kthread_init(void)
{
int error;
- SDT_PROBE(mirage, kernel, kthread_init, entry, 0, 0, 0, 0, 0);
error = kthread_add(mirage_kthread_body, NULL, NULL, &mirage_kthread,
RFSTOPPED, 40, "mirage");
mirage_kthread_state = THR_STOPPED;
@@ -131,34 +114,29 @@ mirage_kthread_init(void)
}
done:
- SDT_PROBE(mirage, kernel, kthread_init, return, error, 0, 0, 0, 0);
return error;
}
static int
mirage_kthread_deinit(void)
{
- SDT_PROBE(mirage, kernel, kthread_deinit, entry, 0, 0, 0, 0, 0);
if (mirage_kthread_state == THR_RUNNING) {
mirage_kthread_state = THR_STOPPED;
tsleep((void *) &mirage_kthread_state, 0,
"mirage_kthread_deinit", 0);
pause("mirage_kthread_deinit", 1);
}
- SDT_PROBE(mirage, kernel, kthread_deinit, return, 0, 0, 0, 0, 0);
return 0;
}
static void
mirage_kthread_launch(void)
{
- SDT_PROBE(mirage, kernel, kthread_launch, entry, 0, 0, 0, 0, 0);
thread_lock(mirage_kthread);
sched_add(mirage_kthread, SRQ_BORING);
sched_class(mirage_kthread, PRI_TIMESHARE);
sched_prio(mirage_kthread, PRI_MAX_IDLE);
thread_unlock(mirage_kthread);
- SDT_PROBE(mirage, kernel, kthread_launch, return, 0, 0, 0, 0, 0);
}
static int
@@ -229,8 +207,7 @@ caml_block_kernel(value v_timeout)
CAMLparam1(v_timeout);
block_timo = Int_val(v_timeout);
- SDT_PROBE(mirage, kernel, block_kernel, entry, block_timo, 0, 0, 0, 0);
+ SDT_PROBE(mirage, kernel, block, timeout, block_timo, 0, 0, 0, 0);
pause("caml_block_kernel", (block_timo * hz) / 1000000);
- SDT_PROBE(mirage, kernel, block_kernel, return, 0, 0, 0, 0, 0);
CAMLreturn(Val_unit);
}
View
8 packages/mirage-platform/runtime/kernel/netif_stubs.c
@@ -30,7 +30,6 @@
#include <sys/socket.h>
#include <sys/param.h>
#include <sys/kernel.h>
-#include <sys/sdt.h>
#include <net/if.h>
#include <net/if_dl.h>
@@ -41,11 +40,6 @@
#include "caml/memory.h"
#include "caml/alloc.h"
-SDT_PROVIDER_DECLARE(mirage);
-
-SDT_PROBE_DEFINE(mirage, kernel, kern_get_vifs, entry, entry);
-SDT_PROBE_DEFINE(mirage, kernel, kern_get_vifs, return, return);
-
/* Currently only Ethernet interfaces are returned. */
CAMLprim value kern_get_vifs(value v_unit);
@@ -58,7 +52,6 @@ kern_get_vifs(value v_unit)
struct ifaddr *ifa;
struct sockaddr_dl *sdl;
- SDT_PROBE(mirage, kernel, kern_get_vifs, entry, 0, 0, 0, 0, 0);
result = Val_emptylist;
IFNET_RLOCK_NOSLEEP();
TAILQ_FOREACH(ifp, &V_ifnet, if_link) {
@@ -79,6 +72,5 @@ kern_get_vifs(value v_unit)
IF_ADDR_RUNLOCK(ifp);
}
IFNET_RUNLOCK_NOSLEEP();
- SDT_PROBE(mirage, kernel, kern_get_vifs, return, 0, 0, 0, 0, 0);
CAMLreturn(result);
}
View
11 packages/mirage-platform/runtime/kernel/page_stubs.c
@@ -37,14 +37,6 @@
#include "caml/fail.h"
#include "caml/bigarray.h"
-SDT_PROVIDER_DECLARE(mirage);
-
-SDT_PROBE_DEFINE(mirage, kernel, alloc_pages, entry, entry);
-SDT_PROBE_ARGTYPE(mirage, kernel, alloc_pages, entry, 0, "size_t");
-SDT_PROBE_DEFINE(mirage, kernel, alloc_pages, return, return);
-SDT_PROBE_DEFINE(mirage, kernel, io_page, contigmalloc, contigmalloc);
-SDT_PROBE_ARGTYPE(mirage, kernel, io_page, contigmalloc, 0, "size_t");
-SDT_PROBE_ARGTYPE(mirage, kernel, io_page, contigmalloc, 1, "unsigned long");
CAMLprim value caml_alloc_pages(value n_pages);
@@ -58,10 +50,8 @@ caml_alloc_pages(value n_pages)
unsigned long block;
len = Int_val(n_pages);
- SDT_PROBE(mirage, kernel, alloc_pages, entry, len, 0, 0, 0, 0);
block = (unsigned long) contigmalloc(PAGE_SIZE * len, M_MIRAGE,
M_NOWAIT, 0, 0xffffffff, PAGE_SIZE, 0ul);
- SDT_PROBE(mirage, kernel, io_page, contigmalloc, PAGE_SIZE * len, block, 0, 0, 0);
if (block == 0)
caml_failwith("contigmalloc");
result = caml_alloc(len, 0);
@@ -71,6 +61,5 @@ caml_alloc_pages(value n_pages)
Store_field(result, i, page);
block += (PAGE_SIZE / sizeof(unsigned long));
};
- SDT_PROBE(mirage, kernel, alloc_pages, return, 0, 0, 0, 0, 0);
CAMLreturn(result);
}
View
8 packages/mirage-platform/runtime/ocaml/bigarray_stubs.c
@@ -41,10 +41,6 @@
#ifdef _KERNEL
SDT_PROVIDER_DECLARE(mirage);
-SDT_PROBE_DEFINE(mirage, kernel, io_page, contigfree, contigfree);
-SDT_PROBE_ARGTYPE(mirage, kernel, io_page, contigfree, 0, "void *");
-SDT_PROBE_ARGTYPE(mirage, kernel, io_page, contigfree, 1, "unsigned long");
-
SDT_PROBE_DEFINE(mirage, kernel, io_page, refcount, refcount);
SDT_PROBE_ARGTYPE(mirage, kernel, io_page, refcount, 0, "void *");
SDT_PROBE_ARGTYPE(mirage, kernel, io_page, refcount, 1, "int");
@@ -584,8 +580,6 @@ static void caml_ba_finalize(value v)
case CAML_BA_MANAGED:
if (b->proxy == NULL) {
#ifdef _KERNEL
- SDT_PROBE(mirage, kernel, io_page, contigfree, b->data, PAGE_SIZE, 0,
- 0, 0);
contigfree(b->data, PAGE_SIZE, M_MIRAGE);
#else
free(b->data);
@@ -595,8 +589,6 @@ static void caml_ba_finalize(value v)
(int) b->proxy->refcount, 0, 0, 0);
if (-- b->proxy->refcount == 0) {
#ifdef _KERNEL
- SDT_PROBE(mirage, kernel, io_page, contigfree, b->proxy->data,
- PAGE_SIZE, 0, 0, 0);
contigfree(b->proxy->data, PAGE_SIZE, M_MIRAGE);
#else
free(b->proxy->data);

0 comments on commit 15b3d0a

Please sign in to comment.
Something went wrong with that request. Please try again.