Skip to content

Commit eab72b0

Browse files
committed
feat: add pre-commit-hooks
1 parent b616032 commit eab72b0

File tree

5 files changed

+5644
-6130
lines changed

5 files changed

+5644
-6130
lines changed

.pre-commit-config.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
exclude: '^(google_benchmark/.*|core/instrument-hooks/.*|.*/build/.*|build/.*)'
4+
files: ^(core|examples)/.*$
5+
6+
repos:
7+
- repo: https://github.com/pre-commit/pre-commit-hooks
8+
rev: v4.5.0
9+
hooks:
10+
- id: trailing-whitespace
11+
- id: end-of-file-fixer
12+
- id: check-added-large-files
13+
- repo: https://github.com/cpp-linter/cpp-linter-hooks
14+
rev: v0.6.1
15+
hooks:
16+
- id: clang-format
17+
files: \.(cpp|cc|cxx|h|hpp)$
18+

core/include/callgrind.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ typedef enum {
8080
} Vg_CallgrindClientRequest;
8181

8282
/* Dump current state of cost centers, and zero them afterwards */
83-
#define CALLGRIND_DUMP_STATS \
83+
#define CALLGRIND_DUMP_STATS \
8484
VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DUMP_STATS, 0, 0, 0, 0, 0)
8585

8686
/* Dump current state of cost centers, and zero them afterwards.
@@ -92,22 +92,22 @@ typedef enum {
9292
0)
9393

9494
/* Zero cost centers */
95-
#define CALLGRIND_ZERO_STATS \
95+
#define CALLGRIND_ZERO_STATS \
9696
VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__ZERO_STATS, 0, 0, 0, 0, 0)
9797

9898
/* Toggles collection state.
9999
The collection state specifies whether the happening of events
100100
should be noted or if they are to be ignored. Events are noted
101101
by increment of counters in a cost center */
102-
#define CALLGRIND_TOGGLE_COLLECT \
102+
#define CALLGRIND_TOGGLE_COLLECT \
103103
VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__TOGGLE_COLLECT, 0, 0, 0, 0, 0)
104104

105105
/* Start full callgrind instrumentation if not already switched on.
106106
When cache simulation is done, it will flush the simulated cache;
107107
this will lead to an artificial cache warmup phase afterwards with
108108
cache misses which would not have happened in reality. */
109-
#define CALLGRIND_START_INSTRUMENTATION \
110-
VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__START_INSTRUMENTATION, 0, 0, 0, \
109+
#define CALLGRIND_START_INSTRUMENTATION \
110+
VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__START_INSTRUMENTATION, 0, 0, 0, \
111111
0, 0)
112112

113113
/* Stop full callgrind instrumentation if not already switched off.
@@ -117,8 +117,8 @@ typedef enum {
117117
Use this to bypass Callgrind aggregation for uninteresting code parts.
118118
To start Callgrind in this mode to ignore the setup phase, use
119119
the option "--instr-atstart=no". */
120-
#define CALLGRIND_STOP_INSTRUMENTATION \
121-
VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__STOP_INSTRUMENTATION, 0, 0, 0, \
120+
#define CALLGRIND_STOP_INSTRUMENTATION \
121+
VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__STOP_INSTRUMENTATION, 0, 0, 0, \
122122
0, 0)
123123

124124
#endif /* __CALLGRIND_H */

0 commit comments

Comments
 (0)