Open aalexand opened 1 month ago
Perhaps one case of having different type of locations per mapping could be if they are language related. E.g. C++ and Rust linked into the same static binary.
@open-telemetry/profiling-maintainers
Another use case is mixed stacktraces, example: Stacktrace with both native and interpreted (Python) frames. Using a frame type per Location
, we'd either keep the same Mapping
for both native and interpreted Locations
or not have a Mapping
for interpreted Locations
.
If we lift Location
type to Mapping
, then we'd need to introduce Mappings
for these interpreted frames which seems semantically wrong.
Another use case is mixed stacktraces, example: Stacktrace with both native and interpreted (Python) frames. Using a frame type per
Location
, we'd either keep the sameMapping
for both native and interpretedLocations
or not have aMapping
for interpretedLocations
.If we lift
Location
type toMapping
, then we'd need to introduceMappings
for these interpreted frames which seems semantically wrong.
I would probably expect two different "fake" mappings to be used in this case - one for interpreted locations, another for JIT locations. Having separate mappings would allow them to have different names (in the Mapping.filename field) which is useful from the tooling / analysis perspective: tools rendering profiles often expose mapping name in a tooltip on the flame graph and easily seeing from the mapping name whether the location is interpreted or JIT is convenient. pprof
also takes the mapping name into account when handling its filters, so using something like -focus=Interpreted
would allow to filter the data to just stacks with interpreted frames.
We define it as
I can't easily think of a case where the type of locations would be different for the given mapping. This could probably be moved to the mapping message which would also save some profile size since locations tend to come in much larger quantities compared to mappings.
Related: Could this type be an attribute? Both mapping and location have attributes attached.