GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — async-profiler/src/itimer.cpp at jonoffcpu-dev · jonoffcpu/async-profiler

Expand file tree

/

itimer.cpp

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
48 lines (39 loc) · 1.15 KB
/

itimer.cpp

Copy path

File metadata and controls

48 lines (39 loc) · 1.15 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
/*
* 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::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.