diff options
| author | Julian Blake Kongslie | 2022-10-15 15:01:25 -0700 |
|---|---|---|
| committer | Julian Blake Kongslie | 2022-10-15 15:01:25 -0700 |
| commit | bcf2314f15d68d7a0b94445f99962342b9d4130d (patch) | |
| tree | 89302b2669e6141ebfc86afc4bd9e19eac0c80bf /infra/pipetrace.h | |
| parent | Stop cycle after accepting restart in fetch. (diff) | |
| download | procmodel-bcf2314f15d68d7a0b94445f99962342b9d4130d.tar.xz | |
Diffstat (limited to '')
| -rw-r--r-- | infra/pipetrace.h | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/infra/pipetrace.h b/infra/pipetrace.h deleted file mode 100644 index 656b9b9..0000000 --- a/infra/pipetrace.h +++ /dev/null | |||
| @@ -1,37 +0,0 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include <cstdint> | ||
| 4 | #include <fmt/format.h> | ||
| 5 | #include <ostream> | ||
| 6 | #include <string> | ||
| 7 | |||
| 8 | namespace infra { | ||
| 9 | struct transaction { | ||
| 10 | std::uint64_t record = ~(std::uint64_t)0; | ||
| 11 | }; | ||
| 12 | |||
| 13 | struct pt { | ||
| 14 | static std::ostream *ptfile; | ||
| 15 | |||
| 16 | static std::uint64_t next_record; | ||
| 17 | |||
| 18 | static transaction toplevel() { | ||
| 19 | transaction t; | ||
| 20 | t.record = next_record++; | ||
| 21 | return t; | ||
| 22 | } | ||
| 23 | |||
| 24 | static transaction child(const transaction &p) { | ||
| 25 | transaction t; | ||
| 26 | t.record = next_record++; | ||
| 27 | if (ptfile) | ||
| 28 | *ptfile << fmt::format("{} parent {}\n", t.record, p.record); | ||
| 29 | return t; | ||
| 30 | } | ||
| 31 | |||
| 32 | static void event(const transaction &t, const char *event, std::uint64_t time, const std::string &data) { | ||
| 33 | if (ptfile) | ||
| 34 | *ptfile << fmt::format("@{} {} {} {}\n", time, t.record, event, data); | ||
| 35 | } | ||
| 36 | }; | ||
| 37 | } | ||
