google/vulkan-performance-layers

Refactor data logging

Closed this issue · 3 comments

kuhar commented

This is a high-level issue for better data logging. Future issues should split this into smaller sub-problems.

performance-layers output two types of logs: event/data logs (layer_data->Log()) and debug logs (LOG(WARNING) << ). We would like to refactor the former one such that layers do not have to worry about the exact output file and output format, yet be able to select from multiple ones.

The goal is to support future logging formats, e.g., chrome event traces.

Requirements:

  • The new classes should be internally-synchronized and not require any mutexes.
  • We should be able to unit-test the implementation without having to run the layers.
  • Do not introduce any new abseil code.

The final set of classes may look something like this:

graph TD;
  aa(Attribute);
  Int64Attr-->aa;
  StringAttr-->aa;
  DurationAttr-->aa;
  TimestampAttr-->aa;
  ...Atr -->aa;

  ae(Event);
  aa -.->|Contains one or more| ae;
Loading
graph LR;
  ae(Event);
  EventA-->ae;
  EventB-->ae;
  EventC-->ae;

  el(EventLogger);
  cl(LeafLogger);
  ae-.->|AddEvent| el;
  el-->BroadcastLogger;
  el-->FilterLogger;
  el-->cl;
Loading
graph TD;
  cl(LeafLogger);
  TestLogger-->cl;
  CsvLogger-->cl;
  CommonLogger-->cl;
  TraceEventLogger-->cl;
Loading
graph LR;
  el(EventLogger);
  ao(LogOutput);
  el-.->|LogLine| ao;
  ao --> StringOutput & FileOutput;
Loading

Subtasks:

  • #75
  • #81
    • Use new logging abstractions for CSV logs
    • Use new logging abstractions for common logs
    • Introduce log output abstraction and implement it for files and strings
  • Allow for string log outputs to be used in unit tests
  • Add event logging implementation for the Chrome Event Tracing format
kuhar commented

Updated the issue to match the updated design.

Can you please update this issue by checking the finished subtasks? i think the only remaining subtask is the last one. Right?

@kuhar, should we close this issue?