[tracing] Extend memory dump API with graphs