Skip to content

Commit 7937f2e

Browse files
cli: move --trace-atomics-wait to eol
1 parent 7c3dce0 commit 7937f2e

8 files changed

+5
-213
lines changed

doc/api/cli.md

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

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

22022169
<!-- YAML
@@ -2727,7 +2694,6 @@ one is included in the list below.
27272694
* `--tls-min-v1.1`
27282695
* `--tls-min-v1.2`
27292696
* `--tls-min-v1.3`
2730-
* `--trace-atomics-wait`
27312697
* `--trace-deprecation`
27322698
* `--trace-event-categories`
27332699
* `--trace-event-file-pattern`
@@ -3191,7 +3157,6 @@ node --stack-trace-limit=12 -p -e "Error.stackTraceLimit" # prints 12
31913157
[`--print`]: #-p---print-script
31923158
[`--redirect-warnings`]: #--redirect-warningsfile
31933159
[`--require`]: #-r---require-module
3194-
[`Atomics.wait()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/wait
31953160
[`Buffer`]: buffer.md#class-buffer
31963161
[`CRYPTO_secure_malloc_init`]: https://www.openssl.org/docs/man3.0/man3/CRYPTO_secure_malloc_init.html
31973162
[`NODE_OPTIONS`]: #node_optionsoptions
@@ -3211,7 +3176,6 @@ node --stack-trace-limit=12 -p -e "Error.stackTraceLimit" # prints 12
32113176
[`tls.DEFAULT_MIN_VERSION`]: tls.md#tlsdefault_min_version
32123177
[`unhandledRejection`]: process.md#event-unhandledrejection
32133178
[`v8.startupSnapshot` API]: v8.md#startup-snapshot-api
3214-
[`worker_threads.threadId`]: worker_threads.md#workerthreadid
32153179
[collecting code coverage from tests]: test.md#collecting-code-coverage
32163180
[conditional exports]: packages.md#conditional-exports
32173181
[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
@@ -481,11 +481,6 @@ but the option is supported for compatibility with older Node.js versions.
481481
Set default minVersion to 'TLSv1.3'. Use to disable support for TLSv1.2 in
482482
favour of TLSv1.3, which is more secure.
483483
.
484-
.It Fl -trace-atomics-wait
485-
Print short summaries of calls to
486-
.Sy Atomics.wait() .
487-
.
488-
This flag is deprecated.
489484
.It Fl -trace-deprecation
490485
Print stack traces for deprecations.
491486
.

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
@@ -668,10 +668,6 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
668668
"throw an exception on deprecations",
669669
&EnvironmentOptions::throw_deprecation,
670670
kAllowedInEnvvar);
671-
AddOption("--trace-atomics-wait",
672-
"(deprecated) trace Atomics.wait() operations",
673-
&EnvironmentOptions::trace_atomics_wait,
674-
kAllowedInEnvvar);
675671
AddOption("--trace-deprecation",
676672
"show stack traces on deprecations",
677673
&EnvironmentOptions::trace_deprecation,

src/node_options.h

-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ class EnvironmentOptions : public Options {
179179
std::string test_shard;
180180
std::vector<std::string> test_skip_pattern;
181181
bool throw_deprecation = false;
182-
bool trace_atomics_wait = false;
183182
bool trace_deprecation = false;
184183
bool trace_exit = false;
185184
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)