1/*
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 *
6 * Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
7 */
8
9/*
10 * @-
11 * @+ Implementation
12 * The commands merely encapsulate the functionality provided by
13 * mal_profiler, which should be explicitly compiled with the kernel, because
14 * it generates a noticable overhead.
15 */
16
17#ifndef _PROFILER_
18#define _PROFILER_
19
20#include "gdk.h"
21#include <time.h>
22#include "mal_stack.h"
23#include "mal_resolve.h"
24#include "mal_exception.h"
25#include "mal_client.h"
26#include "mal_profiler.h"
27#include "mal_interpreter.h"
28#include "mal_runtime.h"
29
30mal_export str CMDstartProfiler(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
31mal_export str CMDstopProfiler(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
32mal_export str CMDstartTrace(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
33mal_export str CMDstopTrace(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
34mal_export str CMDnoopProfiler(void *res);
35mal_export str CMDsetHeartbeat(void *res, int *ev);
36mal_export str CMDopenProfilerStream(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
37mal_export str CMDcloseProfilerStream(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
38mal_export str CMDcleanupTraces(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
39mal_export str CMDgetTrace(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
40mal_export str CMDgetprofilerlimit(int *res);
41mal_export str CMDsetprofilerlimit(void *res, int *lim);
42
43mal_export str CMDgetDiskReads(lng *ret);
44mal_export str CMDgetDiskWrites(lng *ret);
45mal_export str CMDgetUserTime(lng *ret);
46mal_export str CMDgetSystemTime(lng *ret);
47mal_export str CMDcpustats(lng *user, lng *nice, lng *sys, lng *idle, lng *iowait);
48mal_export str CMDcpuloadPercentage(int *cycles, int *io, lng *user, lng *nice, lng *sys, lng *idle, lng *iowait);
49#endif /* _PROFILER_*/
50