From c2665a3d607b60c308739e4289b9bd09b24d0938 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Wed, 26 May 2021 12:49:08 +1000 Subject: [PATCH] ninja_profile: add ninja profile analysis script --- ninja_profile.awk | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 ninja_profile.awk diff --git a/ninja_profile.awk b/ninja_profile.awk new file mode 100755 index 0000000..09c956b --- /dev/null +++ b/ninja_profile.awk @@ -0,0 +1,14 @@ +#!/usr/bin/awk -f + +!/^#/ { + TIMES[$4] += ($2 - $1)/1000 + COUNT[$4] += 1 +} + +END { + for (TGT in TIMES) + AVG[TGT]=TIMES[TGT]/COUNT[TGT] + asorti(AVG, SORTED, "@val_num_desc") + for (num in SORTED) + print AVG[SORTED[num]] " " SORTED[num] +}