CCTLib
Calling-context and data-object attribution library for Intel Pin
footprint_large.c
Go to the documentation of this file.
1
// Footprint victim: LARGE footprint. Load from N distinct addresses in a
2
// stride-1 sweep so each iteration touches a fresh 8-byte slot.
3
#include <stdint.h>
4
5
#define N 100000
6
7
static
volatile
uint64_t
sink
;
8
static
uint64_t
buf
[
N
];
9
10
int
main
(
int
argc,
char
** argv) {
11
(void)argc; (void)argv;
12
// Prime.
13
for
(
int
i = 0; i <
N
; ++i)
buf
[i] = (uint64_t)i;
14
15
uint64_t acc = 0;
16
for
(
int
i = 0; i <
N
; ++i) {
17
volatile
uint64_t* p = &
buf
[i];
18
uint64_t v;
19
__asm__ __volatile__ (
"movq (%1), %0"
:
"=r"
(v) :
"r"
(p) :
"memory"
);
20
acc += v;
21
}
22
sink
= acc;
23
return
0;
24
}
N
#define N
Definition:
footprint_large.c:5
main
int main(int argc, char **argv)
Definition:
footprint_large.c:10
buf
static uint64_t buf[N]
Definition:
footprint_large.c:8
sink
static volatile uint64_t sink
Definition:
footprint_large.c:7
tests
gtest
apps
footprint_large.c
Generated on Wed Jul 15 2026 04:51:30 for CCTLib by
1.9.1