Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8e14135

Browse filesBrowse files
Oleksandr Chekhovskyibnoordhuis
authored andcommitted
src: fix v8::CpuProfiler idle sampling
Ensure that samples are evenly distributed, which is required for v8::CpuProfiler users to work correctly (v8-profiler / node-inspector). PR-URL: #2324 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent 68dc69a commit 8e14135
Copy full SHA for 8e14135

File tree

Expand file treeCollapse file tree

1 file changed

+9
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-4
lines changed
Open diff view settings
Collapse file

‎src/node.cc‎

Copy file name to clipboardExpand all lines: src/node.cc
+9-4Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3567,10 +3567,6 @@ inline void PlatformInit() {
35673567
RegisterSignalHandler(SIGINT, SignalExit, true);
35683568
RegisterSignalHandler(SIGTERM, SignalExit, true);
35693569

3570-
// Block SIGPROF signals when sleeping in epoll_wait/kevent/etc. Avoids the
3571-
// performance penalty of frequent EINTR wakeups when the profiler is running.
3572-
uv_loop_configure(uv_default_loop(), UV_LOOP_BLOCK_SIGNAL, SIGPROF);
3573-
35743570
// Raise the open file descriptor limit.
35753571
struct rlimit lim;
35763572
if (getrlimit(RLIMIT_NOFILE, &lim) == 0 && lim.rlim_cur != lim.rlim_max) {
@@ -3635,6 +3631,15 @@ void Init(int* argc,
36353631
}
36363632
}
36373633

3634+
#ifdef __POSIX__
3635+
// Block SIGPROF signals when sleeping in epoll_wait/kevent/etc. Avoids the
3636+
// performance penalty of frequent EINTR wakeups when the profiler is running.
3637+
// Only do this for v8.log profiling, as it breaks v8::CpuProfiler users.
3638+
if (v8_is_profiling) {
3639+
uv_loop_configure(uv_default_loop(), UV_LOOP_BLOCK_SIGNAL, SIGPROF);
3640+
}
3641+
#endif
3642+
36383643
#if defined(NODE_HAVE_I18N_SUPPORT)
36393644
if (icu_data_dir == nullptr) {
36403645
// if the parameter isn't given, use the env variable.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.