GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — async-profiler/src/itimer.cpp at v4.2 · async-profiler/async-profiler Expand file tree/ Copy pathitimer.cppMore file actions 62 lines (49 loc) · 1.53 KB / Copy pathitimer.cppFile metadata and controls62 lines (49 loc) · 1.53 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 /* * Copyright The async-profiler authors * SPDX-License-Identifier: Apache-2.0 */ #include <sys/time.h> #include "itimer.h" #include "j9StackTraces.h" #include "os.h" #include "vmEntry.h" Error ITimer::check(Arguments& args) { OS::installSignalHandler(SIGPROF, NULL, SIG_IGN); struct itimerval tv_on = {{1, 0}, {1, 0}}; if (setitimer(ITIMER_PROF, &tv_on, NULL) != 0) { return Error("ITIMER_PROF is not supported on this system"); } struct itimerval tv_off = {{0, 0}, {0, 0}}; setitimer(ITIMER_PROF, &tv_off, NULL); return Error::OK; } Error ITimer::start(Arguments& args) { if (args._interval < 0) { return Error("interval must be positive"); } _interval = args._interval ? args._interval : DEFAULT_INTERVAL; _cstack = args._cstack; _signal = SIGPROF; _count_overrun = false; if (VM::isOpenJ9()) { OS::installSignalHandler(SIGPROF, signalHandlerJ9); Error error = J9StackTraces::start(args); if (error) { return error; } } else { OS::installSignalHandler(SIGPROF, signalHandler); } time_t sec = _interval / 1000000000; suseconds_t usec = (_interval % 1000000000) / 1000; struct itimerval tv = {{sec, usec}, {sec, usec}}; if (setitimer(ITIMER_PROF, &tv, NULL) != 0) { return Error("ITIMER_PROF is not supported on this system"); } return Error::OK; } void ITimer::stop() { struct itimerval tv = {{0, 0}, {0, 0}}; setitimer(ITIMER_PROF, &tv, NULL); J9StackTraces::stop(); } |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |