-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/develop'
- Loading branch information
Showing
9 changed files
with
87 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ add_library(util STATIC | |
match_log.cpp | ||
search.cpp | ||
util.cpp | ||
clock.cpp | ||
) | ||
|
||
install( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include <cstdint> | ||
#include <ctime> | ||
#include <iostream> | ||
|
||
static struct timespec start { }; | ||
|
||
extern "C" { | ||
void start_clock() { | ||
clock_gettime(CLOCK_MONOTONIC, &start); | ||
} | ||
|
||
void stop_clock(uint64_t ordinal) { | ||
struct timespec stop { }; | ||
clock_gettime(CLOCK_MONOTONIC, &stop); | ||
int64_t diff_s = stop.tv_sec - start.tv_sec; | ||
int64_t diff_ns = stop.tv_nsec - start.tv_nsec; | ||
|
||
uint64_t diff_ns_total = diff_s * 1000000000 + diff_ns; | ||
|
||
std::cerr << ordinal << " " << diff_ns_total << std::endl; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
# Converts a table of ordinals and seconds to a table of source/location and seconds. Strips directory from file paths. | ||
while read -r ordinal time; do | ||
loc=$(llvm-kompile-compute-loc "$2" $ordinal) | ||
echo "${loc##*/} $time" | ||
done < "$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
# Sorts table of locations and seconds in reverse order and displays it with individual and cumulative percentages. | ||
sum=$(cat "$1" | awk '{sum += $2} END { print sum }') | ||
tac "$1" | awk '{perc_local=$2 / '"$sum"' * 100; perc += perc_local; print $1 " " $2 " " perc_local " " perc}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
# Aggregates data from --profile-matching and sums together identical ordinals, yielding table with ordinals and seconds. | ||
cat "$1" | awk '{sum[$1] += $2} END { for (i in sum) print i, sum[i]}' | sort -n -k2 | awk '{ print $1, $2 / 1000000000}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters