summaryrefslogtreecommitdiff
path: root/src/node_dtrace.cc
AgeCommit message (Collapse)Author
2019-05-13src: remove util-inl.h from header filesSam Roberts
Its intended that *-inl.h header files are only included into the src files that call the inline methods. Explicitly include it into the files that need it. PR-URL: https://github.com/nodejs/node/pull/27631 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-03-21src: fix DTrace GC callbacks DCHECKs and add cleanupJoyee Cheung
Use the variant of GC callbacks that takes data to avoid running into DCHECKs when multiple Environments try to add the same callback to the same isolate multiple times. In addition, remove the callbacks in the Environment cleanup hook. PR-URL: https://github.com/nodejs/node/pull/26742 Fixes: https://github.com/nodejs/node/issues/26736 Reviewed-By: Matheus Marchini <mat@mmarchini.me> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-03-12lib: move DTRACE_* probes out of global scopeJames M Snell
The DTRACE_* probes have been global for no really good reason. Move those into an internalBinding. PR-URL: https://github.com/nodejs/node/pull/26541 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Matheus Marchini <mat@mmarchini.me> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-02-27src: apply clang-tidy rule modernize-deprecated-headersgengjiawen
PR-URL: https://github.com/nodejs/node/pull/26159 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-05worker,etw: only enable ETW on the main threadAnna Henningsen
The Windows ETW code is not written to be compatible with multi threading, and in particular it relies on global state like a single static `uv_async_t`. Adding that to multiple threads would corrupt the corresponding loops' handle queues. This addresses the flakiness of at least `test-worker-exit-code` and very likely other flaky tests that relate to Worker threads on Windows as well. Fixes: https://github.com/nodejs/node/issues/25847 Fixes: https://github.com/nodejs/node/issues/25702 Fixes: https://github.com/nodejs/node/issues/24005 Fixes: https://github.com/nodejs/node/issues/23873 PR-URL: https://github.com/nodejs/node/pull/25907 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-01-21src: reduce includes of node_internals.hJoyee Cheung
PR-URL: https://github.com/nodejs/node/pull/25507 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-11-11src: fix v8 compiler warnings in srcDaniel Bevenius
This commit changes the code to use the maybe version. PR-URL: https://github.com/nodejs/node/pull/24246 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com>
2018-09-24src: replace deprecated uses of FunctionTemplate::GetFunctionAndreas Haas
PR-URL: https://github.com/nodejs/node/pull/22993 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-09-05src: remove calls to deprecated V8 functions (Int32Value)Michaël Zasso
Remove all calls to deprecated V8 functions (here: Value::Int32Value) inside the code. PR-URL: https://github.com/nodejs/node/pull/22662 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
2018-06-07src, tools: add check for left leaning pointersDaniel Bevenius
This commit adds a rule to cpplint to check that pointers in the code base lean to the left and not right, and also fixes the violations reported. PR-URL: https://github.com/nodejs/node/pull/21010 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-04-19src: throw ERR_INVALID_ARG_TYPE in C++ argument checksJoyee Cheung
- Moves THROW_AND_RETURN_IF_NOT_BUFFER and THROW_AND_RETURN_IF_NOT_STRING from node_crypto.cc to node_errors.h so it can be reused. - Move THROW_AND_RETURN_UNLESS_BUFFER in util.h to node_buffer.cc and call THROW_AND_RETURN_IF_NOT_BUFFER there. The only other reference to THROW_AND_RETURN_UNLESS_BUFFER in node_i18n.cc can be safely replaced by an assertion since the argument will be checked in JS land. - Migrate ERR_INVALID_ARG_TYPE errors in C++. We can move the checks to JS land if possible later without having to go semver-major. PR-URL: https://github.com/nodejs/node/pull/20121 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2017-10-30src: do not include x.h if x-inl.h is includedJoyee Cheung
PR-URL: https://github.com/nodejs/node/pull/16548 Fixes: https://github.com/nodejs/node/issues/16519 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-10-12src: node_dtrace line continuations clean upDaniel Bevenius
PR-URL: https://github.com/nodejs/node/pull/15777 Reviewed-By: Lance Ball <lball@redhat.com>
2017-09-14src: refactor `#include` handlingAnna Henningsen
`node_internals.h` already includes the most common headers, so double includes can be avoided in a lot of cases. Also don’t include `node_internals.h` from `node.h` implicitly anymore, as that is mostly unnecessary. PR-URL: https://github.com/nodejs/node/pull/14697 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-03-10meta: restore original copyright headerJames M Snell
A prior io.js era commit inappropriately removed the original copyright statements from the source. This restores those in any files still remaining from that edit. Ref: https://github.com/nodejs/TSC/issues/174 Ref: https://github.com/nodejs/node/pull/10599 PR-URL: https://github.com/nodejs/node/pull/10155 Note: This PR was required, reviewed-by and approved by the Node.js Foundation Legal Committee and the TSC. There is no `Approved-By:` meta data.
2016-12-27dtrace: resolve conversion warnings from SLURP_INTChristopher J. Brody
Resolve build warnings on Windows with the following pattern: warning C4244: '=': conversion from 'int64_t' to 'int32_t', possible loss of data PR-URL: https://github.com/nodejs/node/pull/10143 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
2016-08-08src: remove unused using declsHaojian Wu
PR-URL: https://github.com/nodejs/node/pull/7990 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Minwoo Jung <jmwsoft@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com>
2016-04-05src: replace ARRAY_SIZE with typesafe arraysizeBen Noordhuis
To prevent `ARRAY_SIZE(&arg)` (i.e., taking the array size of a pointer) from happening again. PR-URL: https://github.com/nodejs/node/pull/5969 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2015-12-22src: remove forwards for v8::GC*logueCallbackAli Ijaz Sheikh
These types are no longer used in the file and V8 4.9 no longer defines these types anymore. PR-URL: https://github.com/nodejs/node/pull/4381 Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
2015-09-06src: replace usage of v8::Handle with v8::LocalMichaël Zasso
v8::Handle is deprecated: https://codereview.chromium.org/1224623004 PR-URL: https://github.com/nodejs/io.js/pull/2202 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-03-16make: remove node_dtrace from cpplint excludesJulien Gilli
PR-URL: https://github.com/joyent/node/pull/8741 Reviewed-By: Fedor Indutny <fedor@indutny.com>
2015-02-02src: remove unused dtrace probesGlen Keane
Removed DTRACE_NET_SOCKET_READ and DTRACE_NET_SOCKET_WRITE as they were never called from within the source code. PR-URL: https://github.com/iojs/io.js/pull/694 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-12Remove excessive copyright/license boilerplateisaacs
The copyright and license notice is already in the LICENSE file. There is no justifiable reason to also require that it be included in every file, since the individual files are not individually distributed except as part of the entire package.
2015-01-07src: pass Isolate to node::Utf8Value constructorTrevor Norris
Initial attempt to remove all uses of Isolate::GetCurrent(). Still exists a few locations, but this works out a heavy usage. PR-URL: https://github.com/iojs/io.js/pull/244 Reviewed-by: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-07src: pass Isolate to additional locationsTrevor Norris
Due to a recent V8 upgrade, more methods require Isolate as an argument. PR-URL: https://github.com/iojs/io.js/pull/244 Reviewed-by: Ben Noordhuis <info@bnoordhuis.nl>
2014-10-23src: replace NULL with nullptrBen Noordhuis
Now that we are building with C++11 features enabled, replace use of NULL with nullptr. The benefit of using nullptr is that it can never be confused for an integral type because it does not support implicit conversions to integral types except boolean - unlike NULL, which is defined as a literal `0`.
2014-10-13src: attach env directly to api functionsBen Noordhuis
Attach the per-context execution environment directly to API functions. Rationale: * Gets node one step closer to multi-isolate readiness. * Avoids multi-context confusion, e.g. when the caller and callee live in different contexts. * Avoids expensive calls to pthread_getspecific() on platforms where V8 does not know how to use the thread-local storage directly. (Linux, the BSDs.) PR-URL: https://github.com/node-forward/node/pull/18 Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-10-12src: remove unnecessary HandleScopesBen Noordhuis
API callback functions don't need to create a v8::HandleScope instance because V8 already creates one in the JS->C++ adapter frame. PR-URL: https://github.com/node-forward/node/pull/16 Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-06-10Merge remote-tracking branch 'upstream/v0.10'Timothy J Fontaine
Conflicts: AUTHORS ChangeLog deps/v8/src/api.cc deps/v8/src/unicode-inl.h deps/v8/src/unicode.h lib/_stream_readable.js lib/http.js src/cares_wrap.cc src/node.cc src/node_crypto.cc src/node_dtrace.cc src/node_file.cc src/node_stat_watcher.cc src/node_version.h src/process_wrap.cc src/string_bytes.cc src/string_bytes.h src/udp_wrap.cc src/util.h test/simple/test-buffer.js test/simple/test-stream2-compatibility.js
2014-06-06src: replace usage of String::Utf8ValueTimothy J Fontaine
v8::String::Utf8Value previously could allow invalid surrogates when interpreting values.
2014-03-16src: fix tracing infrastructure after v8 upgradeBen Noordhuis
Fix up the dtrace/etw/systemtap infrastructure after the V8 upgrade in commit 1c7bf24. The win32 changes are untested but can hardly make things worse because node doesn't build on windows right now. Fixes #7313 with some luck.
2014-03-13src: update to v8 3.24 APIsFedor Indutny
2014-03-02Merge remote-tracking branch 'origin/v0.10'Fedor Indutny
Conflicts: configure lib/_stream_readable.js lib/http.js src/node_dtrace.cc
2014-02-22src: remove `node_isolate` from sourceFedor Indutny
fix #6899
2014-02-21dtrace: workaround linker bug on FreeBSDFedor Indutny
2014-02-08Merge remote-tracking branch 'upstream/v0.10'Timothy J Fontaine
Conflicts: deps/v8/src/preparser.cc deps/v8/src/win32-math.h doc/api/http.markdown src/node_buffer.h src/node_crypto.cc src/node_file.cc src/node_http_parser.cc
2014-02-01dtrace: fix arguments warningFedor Indutny
Add enough arguments to `NODE_NET_SOCKET_READ()` and `NODE_NET_SOCKET_WRITE()` stubs.
2013-10-29build: use zero overhead systemtap probesBen Noordhuis
Profiling suggested that on Linux sometimes over 10% of CPU time was being spent inside the systemtap probe entry points in the binding layer, even when the process was not actively being traced with the `stap` tool. That's why this commit makes it possible to use the *_ENABLED() macros and bail out early when we're not being traced, reducing the overhead of unused probes to (almost) zero. Said macros were already being generated by `dtrace -h` but were not usable because they rely on external definitions. To remedy that, we now generate the accompanying object files with `dtrace -G`. This commit includes a change to libuv that has been landed upstream in commit joyent/libuv@3c172ea.
2013-08-09src: use v8::String::NewFrom*() functionsBen Noordhuis
* Change calls to String::New() and String::NewSymbol() to their respective one-byte, two-byte and UTF-8 counterparts. * Add a FIXED_ONE_BYTE_STRING macro that takes a string literal and turns it into a v8::Local<v8::String>. * Add helper functions that make v8::String::NewFromOneByte() easier to work with. Said function expects a `const uint8_t*` but almost every call site deals with `const char*` or `const unsigned char*`. Helps us avoid doing reinterpret_casts all over the place. * Code that handles file system paths keeps using UTF-8 for backwards compatibility reasons. At least now the use of UTF-8 is explicit. * Remove v8::String::NewSymbol() entirely. Almost all call sites were effectively minor de-optimizations. If you create a string only once, there is no point in making it a symbol. If you are create the same string repeatedly, it should probably be cached in a persistent handle.
2013-07-31src: lint c++ codeFedor Indutny
2013-07-06lib, src: upgrade after v8 api changeBen Noordhuis
This is a big commit that touches just about every file in the src/ directory. The V8 API has changed in significant ways. The most important changes are: * Binding functions take a const v8::FunctionCallbackInfo<T>& argument rather than a const v8::Arguments& argument. * Binding functions return void rather than v8::Handle<v8::Value>. The return value is returned with the args.GetReturnValue().Set() family of functions. * v8::Persistent<T> no longer derives from v8::Handle<T> and no longer allows you to directly dereference the object that the persistent handle points to. This means that the common pattern of caching oft-used JS values in a persistent handle no longer quite works, you first need to reconstruct a v8::Local<T> from the persistent handle with the Local<T>::New(isolate, persistent) factory method. A handful of (internal) convenience classes and functions have been added to make dealing with the new API a little easier. The most visible one is node::Cached<T>, which wraps a v8::Persistent<T> with some template sugar. It can hold arbitrary types but so far it's exclusively used for v8::Strings (which was by far the most commonly cached handle type.)
2013-05-22dtrace: unify dtrace and systemtap interfacesTimothy J Fontaine
2013-04-03dtrace: check if _handle property is setBen Noordhuis
Check that _handle is an object before trying to read its `fd` property, avoids bogus values.
2013-04-03dtrace: actually use the _handle.fd valueTimothy J Fontaine
When using the DTrace/systemtap subsystems it would be helpful to actually have an fd associated with the requests and responses.
2013-04-03dtrace: pass more arguments to probesDave Pacheco
OSX and other DTrace implementations don't support dereferencing structs in probes. To accomodate that pass members from the struct as arguments so that DTrace is useful on those systems.
2013-03-30dtrace: check if _handle property is setBen Noordhuis
Check that _handle is an object before trying to read its `fd` property, avoids bogus values.
2013-03-30dtrace: actually use the _handle.fd valueTimothy J Fontaine
When using the DTrace/systemtap subsystems it would be helpful to actually have an fd associated with the requests and responses.
2013-03-30dtrace: pass more arguments to probesDave Pacheco
OSX and other DTrace implementations don't support dereferencing structs in probes. To accomodate that pass members from the struct as arguments so that DTrace is useful on those systems.
2013-03-20src: pass Isolate to all applicable apiTrevor Norris
Update the api to pass node_isolate to all supported methods. Much thanks to Ben Noordhuis and his work in 51f6e6a.
2013-03-20bindings: update apiTrevor Norris
All compile time warnings about using deprecated APIs have been suppressed by updating node's API. Though there are still many function calls that can accept Isolate, and still need to be updated. node_isolate had to be added as an extern variable in node.h and node_object_wrap.h Also a couple small fixes for Error handling. Before v8 3.16.6 the error stack message was lazily written when it was needed, which allowed you to change the message after instantiation. Then the stack would be written with the new message the first time it was accessed. Though that has changed. Now it creates the stack message on instantiation. So setting a different message afterwards won't be displayed. This is not a complete fix for the problem. Getting error without any message isn't very useful.