| Code-Review | +1 |
| Owners-Override | +1 |
bool TraceEventOnFailure(HRESULT hr, perfetto::StaticString name) {Isn't it safer to continue to require a const char* as arg and only cast it to perfetto::StaticString inline below? How do we ensure that caller is safely passing a static string otherwise?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
bool TraceEventOnFailure(HRESULT hr, perfetto::StaticString name) {Isn't it safer to continue to require a const char* as arg and only cast it to perfetto::StaticString inline below? How do we ensure that caller is safely passing a static string otherwise?
If TraceEventOnFailure() takes a const char*, one can do:
```
std::string str = ...
TraceEventOnFailure(..., str.c_str());
```
Whereas taking a StaticString requires explicit conversion which forces the caller to think about it. Either way we can't really enforce the string to be compile time
(we could improve StaticString to be consteval but this is done by changing perfetto).
bool TraceEventOnFailure(HRESULT hr, perfetto::StaticString name) {Etienne Pierre-DorayIsn't it safer to continue to require a const char* as arg and only cast it to perfetto::StaticString inline below? How do we ensure that caller is safely passing a static string otherwise?
If TraceEventOnFailure() takes a const char*, one can do:
```
std::string str = ...
TraceEventOnFailure(..., str.c_str());
```Whereas taking a StaticString requires explicit conversion which forces the caller to think about it. Either way we can't really enforce the string to be compile time
(we could improve StaticString to be consteval but this is done by changing perfetto).
[tracing] Migrate legacy TRACE_EVENT_SCOPE_THREAD instant events
This change is functionally equivalent and mechanical:
TRACE_EVENT_INSTANT[0-3](..., TRACE_EVENT_SCOPE_THREAD) ->
TRACE_EVENT_INSTANT(...)
This main motivation is to isolate remaining legacy TRACE_EVENT_INSTANT
that are emitted outside of the current thread.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |