Hi Leszek, would you mind taking a look at this CL? This is the first CL that I have to enable building V8 with perfetto SDK. I will follow up with making the perfetto processor API in V8 tracing controllers optional with build time flags.
Thanks!
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Camillo, can you PTAL at this? The motivation is that Node.js would have an easier time switching to perfetto if we used only the perfetto sdk, not the full perfetto lib
#if defined(V8_USE_PERFETTO_SDK) && !defined(V8_USE_PERFETTO)I think this can't happen, if you're already setting this with BUILD.gn
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
#if defined(V8_USE_PERFETTO_SDK) && !defined(V8_USE_PERFETTO)I think this can't happen, if you're already setting this with BUILD.gn
Node.js does not use `BUILD.gn` though. This is a fallback in case the embedder's build scripts did not implied `V8_USE_PERFETTO` with `V8_USE_PERFETTO_SDK` correctly.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
#if defined(V8_USE_PERFETTO_SDK) && !defined(V8_USE_PERFETTO)Chengzhong WuI think this can't happen, if you're already setting this with BUILD.gn
Node.js does not use `BUILD.gn` though. This is a fallback in case the embedder's build scripts did not implied `V8_USE_PERFETTO` with `V8_USE_PERFETTO_SDK` correctly.
then you should report an `#error` if things are inconsistent so that that embedder fixes their build scripts, otherwise we might get into a state where someone doesn't include this header, and then can see `V8_USE_PERFETTO_SDK` without `V8_USE_PERFETTO`
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
modulo missing compile-time warning for misconfigured ifdefs looking good.
#include "perfetto/ext/trace_processor/export_json.h"
#include "perfetto/trace_processor/trace_processor.h"Just to confirm – node is fine with having these as separate deps?
// For now most of v8 uses legacy trace events.
// This must be defined before including any perfetto headers.
#define PERFETTO_ENABLE_LEGACY_TRACE_EVENTS 1hope we can slowly move away from the legacy trace events.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
#if defined(V8_USE_PERFETTO_SDK) && !defined(V8_USE_PERFETTO)Chengzhong WuI think this can't happen, if you're already setting this with BUILD.gn
Leszek SwirskiNode.js does not use `BUILD.gn` though. This is a fallback in case the embedder's build scripts did not implied `V8_USE_PERFETTO` with `V8_USE_PERFETTO_SDK` correctly.
then you should report an `#error` if things are inconsistent so that that embedder fixes their build scripts, otherwise we might get into a state where someone doesn't include this header, and then can see `V8_USE_PERFETTO_SDK` without `V8_USE_PERFETTO`
Thanks for suggestion, sounds better to me! Done.
#include "perfetto/ext/trace_processor/export_json.h"
#include "perfetto/trace_processor/trace_processor.h"Just to confirm – node is fine with having these as separate deps?
I will follow up with a CL to guard this behind another build flag, say `V8_USE_PERFETTO_JSON_EXPORT`. I think for Node.js, it is best to avoid output JSON format at all.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
#include "perfetto/ext/trace_processor/export_json.h"
#include "perfetto/trace_processor/trace_processor.h"Chengzhong WuJust to confirm – node is fine with having these as separate deps?
I will follow up with a CL to guard this behind another build flag, say `V8_USE_PERFETTO_JSON_EXPORT`. I think for Node.js, it is best to avoid output JSON format at all.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
[perfetto] Add V8_USE_PERFETTO_SDK build flag
Add a build time flag to use Perfetto SDK header `perfetto.h`.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |