* Find all the original NANO_LOG format strings in the user sources that * statically contain the searchString and print them out in the format * "id | filename | line | format string" * * This function uses the compiled dictionary rather than the one in the log. * * TODO(syang0) while this method will still work for the purposes of * benchmarking, it's better to instead use the in-log di
| 44 | * Static string to search for in the format strings |
| 45 | */ |
| 46 | void |
| 47 | printLogMetadataContainingSubstring(std::string searchString) |
| 48 | { |
| 49 | std::vector<size_t> matchingLogIds; |
| 50 | |
| 51 | for (size_t i = 0; i < GeneratedFunctions::numLogIds; ++i) { |
| 52 | const char *fmtMsg = GeneratedFunctions::logId2Metadata[i].fmtString; |
| 53 | if (strstr(fmtMsg, searchString.c_str())) |
| 54 | matchingLogIds.push_back(i); |
| 55 | } |
| 56 | |
| 57 | printf("%4s | %-20s | %-4s | %s\r\n", "id", "filename", "line", |
| 58 | "format string"); |
| 59 | for (auto id : matchingLogIds) { |
| 60 | GeneratedFunctions::LogMetadata lm = |
| 61 | GeneratedFunctions::logId2Metadata[id]; |
| 62 | printf("%4lu | %-20s | %-4u | %s\r\n", id, lm.fileName, lm.lineNumber, |
| 63 | lm.fmtString); |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | /** |
| 68 | * Produces a GNUPlot graphable reverse CDF graph to stdout given a vector of |