Skip to content

Commit 8f37492

Browse files
cli: move --trace-atomics-wait to eol
PR-URL: #52747 Fixes: #42982 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
1 parent c923ce7 commit 8f37492

8 files changed

+5
-213
lines changed

doc/api/cli.md

-36
Original file line numberDiff line numberDiff line change
@@ -2156,39 +2156,6 @@ added: v12.0.0
21562156
Set default [`tls.DEFAULT_MIN_VERSION`][] to 'TLSv1.3'. Use to disable support
21572157
for TLSv1.2, which is not as secure as TLSv1.3.
21582158

2159-
### `--trace-atomics-wait`
2160-
2161-
<!-- YAML
2162-
added: v14.3.0
2163-
deprecated:
2164-
- v18.8.0
2165-
- v16.18.0
2166-
-->
2167-
2168-
> Stability: 0 - Deprecated
2169-
2170-
Print short summaries of calls to [`Atomics.wait()`][] to stderr.
2171-
The output could look like this:
2172-
2173-
```text
2174-
(node:15701) [Thread 0] Atomics.wait(&lt;address> + 0, 1, inf) started
2175-
(node:15701) [Thread 0] Atomics.wait(&lt;address> + 0, 1, inf) did not wait because the values mismatched
2176-
(node:15701) [Thread 0] Atomics.wait(&lt;address> + 0, 0, 10) started
2177-
(node:15701) [Thread 0] Atomics.wait(&lt;address> + 0, 0, 10) timed out
2178-
(node:15701) [Thread 0] Atomics.wait(&lt;address> + 4, 0, inf) started
2179-
(node:15701) [Thread 1] Atomics.wait(&lt;address> + 4, -1, inf) started
2180-
(node:15701) [Thread 0] Atomics.wait(&lt;address> + 4, 0, inf) was woken up by another thread
2181-
(node:15701) [Thread 1] Atomics.wait(&lt;address> + 4, -1, inf) was woken up by another thread
2182-
```
2183-
2184-
The fields here correspond to:
2185-
2186-
* The thread id as given by [`worker_threads.threadId`][]
2187-
* The base address of the `SharedArrayBuffer` in question, as well as the
2188-
byte offset corresponding to the index passed to `Atomics.wait()`
2189-
* The expected value that was passed to `Atomics.wait()`
2190-
* The timeout passed to `Atomics.wait`
2191-
21922159
### `--trace-deprecation`
21932160

21942161
<!-- YAML
@@ -2718,7 +2685,6 @@ one is included in the list below.
27182685
* `--tls-min-v1.1`
27192686
* `--tls-min-v1.2`
27202687
* `--tls-min-v1.3`
2721-
* `--trace-atomics-wait`
27222688
* `--trace-deprecation`
27232689
* `--trace-event-categories`
27242690
* `--trace-event-file-pattern`
@@ -3181,7 +3147,6 @@ node --stack-trace-limit=12 -p -e "Error.stackTraceLimit" # prints 12
31813147
[`--print`]: #-p---print-script
31823148
[`--redirect-warnings`]: #--redirect-warningsfile
31833149
[`--require`]: #-r---require-module
3184-
[`Atomics.wait()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/wait
31853150
[`Buffer`]: buffer.md#class-buffer
31863151
[`CRYPTO_secure_malloc_init`]: https://www.openssl.org/docs/man3.0/man3/CRYPTO_secure_malloc_init.html
31873152
[`NODE_OPTIONS`]: #node_optionsoptions
@@ -3201,7 +3166,6 @@ node --stack-trace-limit=12 -p -e "Error.stackTraceLimit" # prints 12
32013166
[`tls.DEFAULT_MIN_VERSION`]: tls.md#tlsdefault_min_version
32023167
[`unhandledRejection`]: process.md#event-unhandledrejection
32033168
[`v8.startupSnapshot` API]: v8.md#startup-snapshot-api
3204-
[`worker_threads.threadId`]: worker_threads.md#workerthreadid
32053169
[collecting code coverage from tests]: test.md#collecting-code-coverage
32063170
[conditional exports]: packages.md#conditional-exports
32073171
[context-aware]: addons.md#context-aware-addons

doc/api/deprecations.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -3313,6 +3313,9 @@ Values other than `undefined`, `null`, integer numbers, and integer strings
33133313

33143314
<!-- YAML
33153315
changes:
3316+
- version: REPLACEME
3317+
pr-url: https://github.com/nodejs/node/pull/52747
3318+
description: End-of-Life.
33163319
- version: v22.0.0
33173320
pr-url: https://github.com/nodejs/node/pull/51179
33183321
description: Runtime deprecation.
@@ -3323,9 +3326,9 @@ changes:
33233326
description: Documentation-only deprecation.
33243327
-->
33253328

3326-
Type: Runtime
3329+
Type: End-of-Life
33273330

3328-
The [`--trace-atomics-wait`][] flag is deprecated because
3331+
The `--trace-atomics-wait` flag has been removed because
33293332
it uses the V8 hook `SetAtomicsWaitCallback`,
33303333
that will be removed in a future V8 release.
33313334

@@ -3650,7 +3653,6 @@ is deprecated to better align with recommendations per [NIST SP 800-38D][].
36503653
[`--force-node-api-uncaught-exceptions-policy`]: cli.md#--force-node-api-uncaught-exceptions-policy
36513654
[`--pending-deprecation`]: cli.md#--pending-deprecation
36523655
[`--throw-deprecation`]: cli.md#--throw-deprecation
3653-
[`--trace-atomics-wait`]: cli.md#--trace-atomics-wait
36543656
[`--unhandled-rejections`]: cli.md#--unhandled-rejectionsmode
36553657
[`Buffer.allocUnsafeSlow(size)`]: buffer.md#static-method-bufferallocunsafeslowsize
36563658
[`Buffer.from(array)`]: buffer.md#static-method-bufferfromarray

doc/node.1

-5
Original file line numberDiff line numberDiff line change
@@ -478,11 +478,6 @@ but the option is supported for compatibility with older Node.js versions.
478478
Set default minVersion to 'TLSv1.3'. Use to disable support for TLSv1.2 in
479479
favour of TLSv1.3, which is more secure.
480480
.
481-
.It Fl -trace-atomics-wait
482-
Print short summaries of calls to
483-
.Sy Atomics.wait() .
484-
.
485-
This flag is deprecated.
486481
.It Fl -trace-deprecation
487482
Print stack traces for deprecations.
488483
.

src/node.cc

-49
Original file line numberDiff line numberDiff line change
@@ -214,44 +214,6 @@ void Environment::InitializeInspector(
214214
}
215215
#endif // HAVE_INSPECTOR
216216

217-
#define ATOMIC_WAIT_EVENTS(V) \
218-
V(kStartWait, "started") \
219-
V(kWokenUp, "was woken up by another thread") \
220-
V(kTimedOut, "timed out") \
221-
V(kTerminatedExecution, "was stopped by terminated execution") \
222-
V(kAPIStopped, "was stopped through the embedder API") \
223-
V(kNotEqual, "did not wait because the values mismatched") \
224-
225-
static void AtomicsWaitCallback(Isolate::AtomicsWaitEvent event,
226-
Local<v8::SharedArrayBuffer> array_buffer,
227-
size_t offset_in_bytes, int64_t value,
228-
double timeout_in_ms,
229-
Isolate::AtomicsWaitWakeHandle* stop_handle,
230-
void* data) {
231-
Environment* env = static_cast<Environment*>(data);
232-
233-
const char* message = "(unknown event)";
234-
switch (event) {
235-
#define V(key, msg) \
236-
case Isolate::AtomicsWaitEvent::key: \
237-
message = msg; \
238-
break;
239-
ATOMIC_WAIT_EVENTS(V)
240-
#undef V
241-
}
242-
243-
fprintf(stderr,
244-
"(node:%d) [Thread %" PRIu64 "] Atomics.wait(%p + %zx, %" PRId64
245-
", %.f) %s\n",
246-
static_cast<int>(uv_os_getpid()),
247-
env->thread_id(),
248-
array_buffer->Data(),
249-
offset_in_bytes,
250-
value,
251-
timeout_in_ms,
252-
message);
253-
}
254-
255217
void Environment::InitializeDiagnostics() {
256218
isolate_->GetHeapProfiler()->AddBuildEmbedderGraphCallback(
257219
Environment::BuildEmbedderGraph, this);
@@ -260,17 +222,6 @@ void Environment::InitializeDiagnostics() {
260222
}
261223
if (options_->trace_uncaught)
262224
isolate_->SetCaptureStackTraceForUncaughtExceptions(true);
263-
if (options_->trace_atomics_wait) {
264-
ProcessEmitDeprecationWarning(
265-
Environment::GetCurrent(isolate_),
266-
"The flag --trace-atomics-wait is deprecated.",
267-
"DEP0165");
268-
isolate_->SetAtomicsWaitCallback(AtomicsWaitCallback, this);
269-
AddCleanupHook([](void* data) {
270-
Environment* env = static_cast<Environment*>(data);
271-
env->isolate()->SetAtomicsWaitCallback(nullptr, nullptr);
272-
}, this);
273-
}
274225
if (options_->trace_promises) {
275226
isolate_->SetPromiseHook(TracePromises);
276227
}

src/node_options.cc

-4
Original file line numberDiff line numberDiff line change
@@ -664,10 +664,6 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
664664
"throw an exception on deprecations",
665665
&EnvironmentOptions::throw_deprecation,
666666
kAllowedInEnvvar);
667-
AddOption("--trace-atomics-wait",
668-
"(deprecated) trace Atomics.wait() operations",
669-
&EnvironmentOptions::trace_atomics_wait,
670-
kAllowedInEnvvar);
671667
AddOption("--trace-deprecation",
672668
"show stack traces on deprecations",
673669
&EnvironmentOptions::trace_deprecation,

src/node_options.h

-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ class EnvironmentOptions : public Options {
178178
std::string test_shard;
179179
std::vector<std::string> test_skip_pattern;
180180
bool throw_deprecation = false;
181-
bool trace_atomics_wait = false;
182181
bool trace_deprecation = false;
183182
bool trace_exit = false;
184183
bool trace_sync_io = false;

test/parallel/test-trace-atomic-deprecation.js

-14
This file was deleted.

test/parallel/test-trace-atomics-wait.js

-101
This file was deleted.

0 commit comments

Comments
 (0)