diff --git a/.appveyor.yml b/.appveyor.yml index b68f34b0..f9d57c63 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -15,11 +15,13 @@ build_script: - cmd: msbuild .\update\build\win32\update.vcxproj - cmd: msbuild .\profiler\build\win32\Tracy.vcxproj - cmd: msbuild .\capture\build\win32\capture.vcxproj + - cmd: msbuild .\csvexport\build\win32\csvexport.vcxproj - cmd: msbuild .\library\win32\TracyProfiler.vcxproj /property:Configuration=Release - sh: sudo apt-get update && sudo apt-get -y install libglfw3-dev libgtk2.0-dev libcapstone-dev - sh: make -C update/build/unix debug release - sh: make -C profiler/build/unix debug release - sh: make -C capture/build/unix debug release + - sh: make -C csvexport/build/unix debug release - sh: make -C library/unix debug release - sh: make -C test - sh: make -C test clean diff --git a/.github/workflows/gcc.yml b/.github/workflows/gcc.yml index 1d6a952f..7a71bfef 100644 --- a/.github/workflows/gcc.yml +++ b/.github/workflows/gcc.yml @@ -29,6 +29,8 @@ jobs: run: make -j -C update/build/unix debug release - name: Capture utility run: make -j -C capture/build/unix debug release + - name: Csvexport utility + run: make -j -C csvexport/build/unix debug release - name: Import-chrome utility run: make -j -C import-chrome/build/unix debug release - name: Library diff --git a/.github/workflows/msvc.yml b/.github/workflows/msvc.yml index 60734a80..8df3bc17 100644 --- a/.github/workflows/msvc.yml +++ b/.github/workflows/msvc.yml @@ -30,6 +30,10 @@ jobs: run: msbuild .\capture\build\win32\capture.vcxproj /property:Configuration=Debug /property:Platform=x64 - name: Capture utility Release run: msbuild .\capture\build\win32\capture.vcxproj /property:Configuration=Release /property:Platform=x64 + - name: Csvexport utility Debug + run: msbuild .\csvexport\build\win32\csvexport.vcxproj /property:Configuration=Debug /property:Platform=x64 + - name: Csvexport utility Release + run: msbuild .\csvexport\build\win32\csvexport.vcxproj /property:Configuration=Release /property:Platform=x64 - name: Import-chrome utility Debug run: msbuild .\import-chrome\build\win32\import-chrome.vcxproj /property:Configuration=Debug /property:Platform=x64 - name: Import-chrome utility Release diff --git a/AUTHORS b/AUTHORS index 7320b73b..747c9d66 100644 --- a/AUTHORS +++ b/AUTHORS @@ -10,3 +10,4 @@ Michał Cichoń (OSX call stack decoding b Thales Sabino (OpenCL support) Andrew Depke (Direct3D 12 support) Simonas Kazlauskas (OSX CI, external bindings) +Jakub Žádník (csvexport utility) diff --git a/capture/build/win32/capture.vcxproj b/capture/build/win32/capture.vcxproj index ffea25c1..2a9230b3 100644 --- a/capture/build/win32/capture.vcxproj +++ b/capture/build/win32/capture.vcxproj @@ -138,6 +138,7 @@ + @@ -171,7 +172,6 @@ - @@ -184,6 +184,7 @@ + @@ -227,7 +228,6 @@ - diff --git a/capture/build/win32/capture.vcxproj.filters b/capture/build/win32/capture.vcxproj.filters index 30b334b5..8b0cc276 100644 --- a/capture/build/win32/capture.vcxproj.filters +++ b/capture/build/win32/capture.vcxproj.filters @@ -13,6 +13,9 @@ {043ecb94-f240-4986-94b0-bc5bbd415a82} + + {ee9737d2-69c7-44da-b9c7-539d18f9d4b4} + @@ -33,9 +36,6 @@ src - - src - common @@ -129,6 +129,9 @@ server + + getopt + @@ -179,9 +182,6 @@ server - - src - common @@ -293,5 +293,8 @@ server + + getopt + \ No newline at end of file diff --git a/capture/src/capture.cpp b/capture/src/capture.cpp index 341f8c02..6b911b85 100644 --- a/capture/src/capture.cpp +++ b/capture/src/capture.cpp @@ -15,7 +15,7 @@ #include "../../server/TracyMemory.hpp" #include "../../server/TracyPrint.hpp" #include "../../server/TracyWorker.hpp" -#include "getopt.h" +#include "../../getopt/getopt.h" bool disconnect = false; diff --git a/csvexport/build/unix/Makefile b/csvexport/build/unix/Makefile new file mode 100644 index 00000000..3b50301c --- /dev/null +++ b/csvexport/build/unix/Makefile @@ -0,0 +1,12 @@ +all: debug + +debug: + @+make -f debug.mk all + +release: + @+make -f release.mk all + +clean: + @+make -f build.mk clean + +.PHONY: all clean debug release diff --git a/csvexport/build/unix/build.mk b/csvexport/build/unix/build.mk new file mode 100644 index 00000000..a7a67460 --- /dev/null +++ b/csvexport/build/unix/build.mk @@ -0,0 +1,60 @@ +CFLAGS += +CXXFLAGS := $(CFLAGS) -std=gnu++17 +# DEFINES += -DTRACY_NO_STATISTICS +INCLUDES := $(shell pkg-config --cflags capstone) +LIBS := $(shell pkg-config --libs capstone) -lpthread +PROJECT := csvexport +IMAGE := $(PROJECT)-$(BUILD) + +FILTER := + +BASE := $(shell egrep 'ClCompile.*cpp"' ../win32/$(PROJECT).vcxproj | sed -e 's/.*\"\(.*\)\".*/\1/' | sed -e 's@\\@/@g') +BASE2 := $(shell egrep 'ClCompile.*c"' ../win32/$(PROJECT).vcxproj | sed -e 's/.*\"\(.*\)\".*/\1/' | sed -e 's@\\@/@g') + +SRC := $(filter-out $(FILTER),$(BASE)) +SRC2 := $(filter-out $(FILTER),$(BASE2)) + +TBB := $(shell ld -ltbb -o /dev/null 2>/dev/null; echo $$?) +ifeq ($(TBB),0) + LIBS += -ltbb +endif + +OBJDIRBASE := obj/$(BUILD) +OBJDIR := $(OBJDIRBASE)/o/o/o + +OBJ := $(addprefix $(OBJDIR)/,$(SRC:%.cpp=%.o)) +OBJ2 := $(addprefix $(OBJDIR)/,$(SRC2:%.c=%.o)) + +all: $(IMAGE) + +$(OBJDIR)/%.o: %.cpp + $(CXX) -c $(INCLUDES) $(CXXFLAGS) $(DEFINES) $< -o $@ + +$(OBJDIR)/%.d : %.cpp + @echo Resolving dependencies of $< + @mkdir -p $(@D) + @$(CXX) -MM $(INCLUDES) $(CXXFLAGS) $(DEFINES) $< > $@.$$$$; \ + sed 's,.*\.o[ :]*,$(OBJDIR)/$(<:.cpp=.o) $@ : ,g' < $@.$$$$ > $@; \ + rm -f $@.$$$$ + +$(OBJDIR)/%.o: %.c + $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ + +$(OBJDIR)/%.d : %.c + @echo Resolving dependencies of $< + @mkdir -p $(@D) + @$(CC) -MM $(INCLUDES) $(CFLAGS) $(DEFINES) $< > $@.$$$$; \ + sed 's,.*\.o[ :]*,$(OBJDIR)/$(<:.c=.o) $@ : ,g' < $@.$$$$ > $@; \ + rm -f $@.$$$$ + +$(IMAGE): $(OBJ) $(OBJ2) + $(CXX) $(CXXFLAGS) $(DEFINES) $(OBJ) $(OBJ2) $(LIBS) -o $@ + +ifneq "$(MAKECMDGOALS)" "clean" +-include $(addprefix $(OBJDIR)/,$(SRC:.cpp=.d)) $(addprefix $(OBJDIR)/,$(SRC2:.c=.d)) +endif + +clean: + rm -rf $(OBJDIRBASE) $(IMAGE)* + +.PHONY: clean all diff --git a/csvexport/build/unix/debug.mk b/csvexport/build/unix/debug.mk new file mode 100644 index 00000000..04d925a6 --- /dev/null +++ b/csvexport/build/unix/debug.mk @@ -0,0 +1,11 @@ +ARCH := $(shell uname -m) + +CFLAGS := -g3 -Wall +DEFINES := -DDEBUG +BUILD := debug + +ifeq ($(ARCH),x86_64) +CFLAGS += -msse4.1 +endif + +include build.mk diff --git a/csvexport/build/unix/release.mk b/csvexport/build/unix/release.mk new file mode 100644 index 00000000..b59abd5c --- /dev/null +++ b/csvexport/build/unix/release.mk @@ -0,0 +1,7 @@ +ARCH := $(shell uname -m) + +CFLAGS := -O3 -s -march=native +DEFINES := -DNDEBUG +BUILD := release + +include build.mk diff --git a/csvexport/build/win32/csvexport.sln b/csvexport/build/win32/csvexport.sln new file mode 100644 index 00000000..41975ed3 --- /dev/null +++ b/csvexport/build/win32/csvexport.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30225.117 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "csvexport", "csvexport.vcxproj", "{447D58BF-94CD-4469-BB90-549C05D03E00}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {447D58BF-94CD-4469-BB90-549C05D03E00}.Debug|x64.ActiveCfg = Debug|x64 + {447D58BF-94CD-4469-BB90-549C05D03E00}.Debug|x64.Build.0 = Debug|x64 + {447D58BF-94CD-4469-BB90-549C05D03E00}.Debug|x86.ActiveCfg = Debug|Win32 + {447D58BF-94CD-4469-BB90-549C05D03E00}.Debug|x86.Build.0 = Debug|Win32 + {447D58BF-94CD-4469-BB90-549C05D03E00}.Release|x64.ActiveCfg = Release|x64 + {447D58BF-94CD-4469-BB90-549C05D03E00}.Release|x64.Build.0 = Release|x64 + {447D58BF-94CD-4469-BB90-549C05D03E00}.Release|x86.ActiveCfg = Release|Win32 + {447D58BF-94CD-4469-BB90-549C05D03E00}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {3E51386C-43EA-44AC-9F24-AFAFE4D63ADE} + EndGlobalSection +EndGlobal diff --git a/csvexport/build/win32/csvexport.vcxproj b/csvexport/build/win32/csvexport.vcxproj new file mode 100644 index 00000000..b350fe5e --- /dev/null +++ b/csvexport/build/win32/csvexport.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 15.0 + {447D58BF-94CD-4469-BB90-549C05D03E00} + capture + 10.0 + x64-windows-static + + + + Application + true + v142 + MultiByte + + + Application + false + v142 + true + MultiByte + + + Application + true + v142 + MultiByte + + + Application + false + v142 + true + MultiByte + + + + + + + + + + + + + + + + + + + + + + + Level3 + Disabled + true + true + + + + + Level3 + Disabled + true + true + true + _CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32_LEAN_AND_MEAN;NOMINMAX;_USE_MATH_DEFINES;%(PreprocessorDefinitions) + AdvancedVectorExtensions2 + stdcpplatest + ..\..\..\vcpkg\vcpkg\installed\x64-windows-static\include + + + ws2_32.lib;capstone.lib;%(AdditionalDependencies) + Console + ..\..\..\vcpkg\vcpkg\installed\x64-windows-static\debug\lib + + + + + Level3 + MaxSpeed + true + true + true + true + + + true + true + + + + + Level3 + MaxSpeed + true + true + true + true + true + NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32_LEAN_AND_MEAN;NOMINMAX;_USE_MATH_DEFINES;%(PreprocessorDefinitions) + AdvancedVectorExtensions2 + stdcpplatest + ..\..\..\vcpkg\vcpkg\installed\x64-windows-static\include + + + true + true + ws2_32.lib;capstone.lib;%(AdditionalDependencies) + Console + ..\..\..\vcpkg\vcpkg\installed\x64-windows-static\lib + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/csvexport/build/win32/csvexport.vcxproj.filters b/csvexport/build/win32/csvexport.vcxproj.filters new file mode 100644 index 00000000..045ffe8b --- /dev/null +++ b/csvexport/build/win32/csvexport.vcxproj.filters @@ -0,0 +1,300 @@ + + + + + {729c80ee-4d26-4a5e-8f1f-6c075783eb56} + + + {cf23ef7b-7694-4154-830b-00cf053350ea} + + + {e39d3623-47cd-4752-8da9-3ea324f964c1} + + + {043ecb94-f240-4986-94b0-bc5bbd415a82} + + + {ee9737d2-69c7-44da-b9c7-539d18f9d4b4} + + + + + common + + + common + + + common + + + server + + + server + + + common + + + server + + + server + + + server + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + server + + + server + + + getopt + + + src + + + + + common + + + common + + + common + + + common + + + common + + + common + + + common + + + common + + + server + + + server + + + server + + + server + + + server + + + server + + + server + + + server + + + common + + + common + + + server + + + server + + + server + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + zstd + + + server + + + server + + + server + + + getopt + + + \ No newline at end of file diff --git a/csvexport/src/csvexport.cpp b/csvexport/src/csvexport.cpp new file mode 100644 index 00000000..c0654c44 --- /dev/null +++ b/csvexport/src/csvexport.cpp @@ -0,0 +1,311 @@ +#ifdef _WIN32 +# include +#endif + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "../../server/TracyFileRead.hpp" +#include "../../server/TracyWorker.hpp" +#include "../../getopt/getopt.h" + +void print_usage_exit(int e) +{ + fprintf(stderr, "Extract statistics from a trace to a CSV format\n"); + fprintf(stderr, "Usage:\n"); + fprintf(stderr, " extract [OPTION...] \n"); + fprintf(stderr, "\n"); + fprintf(stderr, " -h, --help Print usage\n"); + fprintf(stderr, " -f, --filter arg Filter zone names (default: "")\n"); + fprintf(stderr, " -s, --sep arg CSV separator (default: ,)\n"); + fprintf(stderr, " -c, --case Case sensitive filtering\n"); + fprintf(stderr, " -e, --self Get self times\n"); + fprintf(stderr, " -u, --unwrap Report each zone event\n"); + + exit(e); +} + +struct Args { + const char* filter; + const char* separator; + const char* trace_file; + bool case_sensitive; + bool self_time; + bool unwrap; +}; + +Args parse_args(int argc, char** argv) +{ + if (argc == 1) + { + print_usage_exit(1); + } + + Args args = { "", ",", "", false, false, false }; + + struct option long_opts[] = { + { "help", no_argument, NULL, 'h' }, + { "filter", optional_argument, NULL, 'f' }, + { "sep", optional_argument, NULL, 's' }, + { "case", no_argument, NULL, 'c' }, + { "self", no_argument, NULL, 'e' }, + { "unwrap", no_argument, NULL, 'u' }, + { NULL, 0, NULL, 0 } + }; + + int c; + while ((c = getopt_long(argc, argv, "hf:s:ceu", long_opts, NULL)) != -1) + { + switch (c) + { + case 'h': + print_usage_exit(0); + break; + case 'f': + args.filter = optarg; + break; + case 's': + args.separator = optarg; + break; + case 'c': + args.case_sensitive = true; + break; + case 'e': + args.self_time = true; + break; + case 'u': + args.unwrap = true; + break; + default: + print_usage_exit(1); + break; + } + } + + if (argc != optind + 1) + { + print_usage_exit(1); + } + + args.trace_file = argv[optind]; + + return args; +} + +bool is_substring( + const char* term, + const char* s, + bool case_sensitive = false +){ + auto new_term = std::string(term); + auto new_s = std::string(s); + + if (!case_sensitive) { + std::transform( + new_term.begin(), + new_term.end(), + new_term.begin(), + [](unsigned char c){ return std::tolower(c); } + ); + + std::transform( + new_s.begin(), + new_s.end(), + new_s.begin(), + [](unsigned char c){ return std::tolower(c); } + ); + } + + return new_s.find(new_term) != std::string::npos; +} + +const char* get_name(int32_t id, const tracy::Worker& worker) +{ + auto& srcloc = worker.GetSourceLocation(id); + return worker.GetString(srcloc.name.active ? srcloc.name : srcloc.function); +} + +template +std::string join(const T& v, const char* sep) { + std::ostringstream s; + for (const auto& i : v) { + if (&i != &v[0]) { + s << sep; + } + s << i; + } + return s.str(); +} + +// From TracyView.cpp +int64_t GetZoneChildTimeFast( + const tracy::Worker& worker, + const tracy::ZoneEvent& zone +){ + int64_t time = 0; + if( zone.HasChildren() ) + { + auto& children = worker.GetZoneChildren( zone.Child() ); + if( children.is_magic() ) + { + auto& vec = *(tracy::Vector*)&children; + for( auto& v : vec ) + { + assert( v.IsEndValid() ); + time += v.End() - v.Start(); + } + } + else + { + for( auto& v : children ) + { + assert( v->IsEndValid() ); + time += v->End() - v->Start(); + } + } + } + return time; +} + +int main(int argc, char** argv) +{ +#ifdef _WIN32 + if (!AttachConsole(ATTACH_PARENT_PROCESS)) + { + AllocConsole(); + SetConsoleMode(GetStdHandle(STD_OUTPUT_HANDLE), 0x07); + } +#endif + + Args args = parse_args(argc, argv); + + auto f = std::unique_ptr( + tracy::FileRead::Open(args.trace_file) + ); + if (!f) + { + fprintf(stderr, "Could not open file %s\n", args.trace_file); + return 1; + } + + auto worker = tracy::Worker(*f); + + while (!worker.AreSourceLocationZonesReady()) + { + std::this_thread::sleep_for(std::chrono::milliseconds(10)); + } + + auto& slz = worker.GetSourceLocationZones(); + tracy::Vector slz_selected; + slz_selected.reserve(slz.size()); + + uint32_t total_cnt = 0; + for(auto it = slz.begin(); it != slz.end(); ++it) + { + if(it->second.total != 0) + { + ++total_cnt; + if(args.filter[0] == '\0') + { + slz_selected.push_back_no_space_check(it); + } + else + { + auto name = get_name(it->first, worker); + if(is_substring(args.filter, name, args.case_sensitive)) + { + slz_selected.push_back_no_space_check(it); + } + } + } + } + + std::vector columns; + if (args.unwrap) + { + columns = { + "name", "src_file", "src_line", "ns_since_start", "exec_time_ns" + }; + } + else + { + columns = { + "name", "src_file", "src_line", "total_ns", "total_perc", + "counts", "mean_ns", "min_ns", "max_ns", "std_ns" + }; + } + std::string header = join(columns, args.separator); + printf("%s\n", header.data()); + + const auto last_time = worker.GetLastTime(); + for(auto& it : slz_selected) + { + std::vector values(columns.size()); + + values[0] = get_name(it->first, worker); + + const auto& srcloc = worker.GetSourceLocation(it->first); + values[1] = worker.GetString(srcloc.file); + values[2] = std::to_string(srcloc.line); + + const auto& zone_data = it->second; + + if (args.unwrap) + { + int i = 0; + for (const auto& zone_thread_data : zone_data.zones) { + const auto zone_event = zone_thread_data.Zone(); + const auto start = zone_event->Start(); + const auto end = zone_event->End(); + + values[3] = std::to_string(start); + + auto timespan = end - start; + if (args.self_time) { + timespan -= GetZoneChildTimeFast(worker, *zone_event); + } + values[4] = std::to_string(timespan); + + std::string row = join(values, args.separator); + printf("%s\n", row.data()); + } + } + else + { + const auto time = args.self_time ? zone_data.selfTotal : zone_data.total; + values[3] = std::to_string(time); + values[4] = std::to_string(100. * time / last_time); + + values[5] = std::to_string(zone_data.zones.size()); + + const auto avg = (args.self_time ? zone_data.selfTotal : zone_data.total) + / zone_data.zones.size(); + values[6] = std::to_string(avg); + + const auto tmin = args.self_time ? zone_data.selfMin : zone_data.min; + const auto tmax = args.self_time ? zone_data.selfMax : zone_data.max; + values[7] = std::to_string(tmin); + values[8] = std::to_string(tmax); + + const auto sz = zone_data.zones.size(); + const auto ss = zone_data.sumSq + - 2. * zone_data.total * avg + + avg * avg * sz; + const auto std = sqrt(ss / (sz - 1)); + values[9] = std::to_string(std); + + std::string row = join(values, args.separator); + printf("%s\n", row.data()); + } + } + + return 0; +} diff --git a/capture/src/getopt.c b/getopt/getopt.c similarity index 100% rename from capture/src/getopt.c rename to getopt/getopt.c diff --git a/capture/src/getopt.h b/getopt/getopt.h similarity index 100% rename from capture/src/getopt.h rename to getopt/getopt.h diff --git a/manual/tracy.tex b/manual/tracy.tex index 027b6e70..bbb18ff1 100644 --- a/manual/tracy.tex +++ b/manual/tracy.tex @@ -104,6 +104,7 @@ Hello and welcome to the Tracy Profiler user manual! Here you will find all the \item Chapter~\ref{client}, \emph{\nameref{client}}, provides information on how to instrument your application, in order to retrieve useful profiling data. \item Chapter~\ref{capturing}, \emph{\nameref{capturing}}, goes into more detail on how the profiling information can be captured and stored on disk. \item Chapter~\ref{analyzingdata}, \emph{\nameref{analyzingdata}}, guides you through the graphical user interface of the profiler. +\item Chapter~\ref{csvexport}, \emph{\nameref{csvexport}}, explains how to export some zone timing statistics into a CSV format. \item Chapter~\ref{importingdata}, \emph{\nameref{importingdata}}, documents how to import data from other profilers. \item Chapter~\ref{configurationfiles}, \emph{\nameref{configurationfiles}}, gives information on the profiler settings. \end{itemize} @@ -3017,6 +3018,37 @@ This window lists all annotations marked on the timeline. Each annotation is pre \label{figannlist} \end{figure} +\section{Exporting zone statistics to CSV} +\label{csvexport} + +You can use a command-line utility in the \texttt{csvexport} directory to export basic zone statistics from a saved trace into a CSV format. +The tool requires a single .tracy file as an argument and prints results into the standard output (stdout) from where you can redirect it into a file or use it as an input into another tool. +By default, the utility will list all zones with the following columns: + +\begin{itemize} + \item \texttt{name} -- Zone name + \item \texttt{src\_file} -- Source file where the zone was set + \item \texttt{src\_line} -- Line in the source file where the zone was set + \item \texttt{total\_ns} -- Total zone time in nanoseconds + \item \texttt{total\_perc} -- Total zone time as a percentage of the program's execution time + \item \texttt{counts} -- Zone count + \item \texttt{mean\_ns} -- Mean zone time (equivalent in MPTC in the profiler GUI) in nanoseconds + \item \texttt{min\_ns} -- Minimum zone time in nanoseconds + \item \texttt{max\_ns} -- Maximum zone time in nanoseconds + \item \texttt{std\_ns} -- Standard deviation of the zone time in nanoseconds +\end{itemize} + +You can customize the output with the following command line options: + +\begin{itemize} + \item \texttt{-h, -\hspace{-1.25ex} -help} -- display a help message + \item \texttt{-f, -\hspace{-1.25ex} -filter } -- filter the zone names + \item \texttt{-c, -\hspace{-1.25ex} -case} -- make the name filtering case sensitive + \item \texttt{-s, -\hspace{-1.25ex} -sep } -- customize the CSV separator (default is ``\texttt{,}'') + \item \texttt{-e, -\hspace{-1.25ex} -self} -- use self time (equivalent to the ``Self time'' toggle in the profiler GUI) + \item \texttt{-u, -\hspace{-1.25ex} -unwrap} -- report each zone individually; this will discard the statistics columns and instead reports for each zone entry its timestamp and the duration of the zone entry. +\end{itemize} + \section{Importing external profiling data} \label{importingdata}