Make focus's "Benchmark" prefix optional.

This commit is contained in:
Nigel Tao committed 2017-11-04 10:25:24 +11:00
1 parent 0230a65c7b
commit 4729170678
3 files changed
+15 -2

No files matched your search

+2 -1
View File
@@ -28,7 +28,8 @@ import (
func isStringList(s string) bool {
for i := 0; i < len(s); i++ {
c := s[i]
if c == ',' || c == '-' || c == '.' || ('0' <= c && c <= '9') || c == '_' || ('a' <= c && c <= 'z') {
if c == ',' || c == '-' || c == '.' || ('0' <= c && c <= '9') || ('A' <= c && c <= 'Z') ||
c == '_' || ('a' <= c && c <= 'z') {
continue
}
return false
+2 -1
View File
@@ -26,7 +26,8 @@ import (
func isStringList(s string) bool {
for i := 0; i < len(s); i++ {
c := s[i]
if c == ',' || c == '-' || c == '.' || ('0' <= c && c <= '9') || c == '_' || ('a' <= c && c <= 'z') {
if c == ',' || c == '-' || c == '.' || ('0' <= c && c <= '9') || ('A' <= c && c <= 'Z') ||
c == '_' || ('a' <= c && c <= 'z') {
continue
}
return false
+11
View File
@@ -66,6 +66,17 @@ bool check_focus() {
// No-op. Skip empty focus targets, which makes it convenient to
// copy/paste a string with a trailing comma.
} else {
// Strip a leading "Benchmark", if present, from the [p, q) string.
// Idiomatic C function names look like "test_puffs_gif_lzw_decode_pi"
// and won't start with "Benchmark". Stripping lets us conveniently
// copy/paste a string like "Benchmarkpuffs_gif_decode_10k/gcc" from the
// "puffs bench std/gif" output.
//
// TODO: strip the "/gcc".
if (!strncmp(p, "Benchmark", 9)) {
p += 9;
}
// See if proc_funcname (with or without a "test_" or "bench_" prefix)
// starts with the [p, q) string.
if (!strncmp(proc_funcname, p, q - p)) {