summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2023-01-25 20:21:40 +0100
committerLouis Burda <quent.burda@gmail.com>2023-01-25 20:21:40 +0100
commitcb7c6b3d6767335d13892451c141cfb717807712 (patch)
tree466ec00a60d6350aa51738870f4b73b4b5c90790
parent5975ec7b44887ad54417218251e669cca14bde80 (diff)
downloadcachepc-cb7c6b3d6767335d13892451c141cfb717807712.tar.gz
cachepc-cb7c6b3d6767335d13892451c141cfb717807712.zip
Use mfence instead of lfence for memory barrier
-rwxr-xr-xMakefile2
-rw-r--r--cachepc/cachepc.c4
-rw-r--r--cachepc/macro.S4
-rw-r--r--cachepc/uapi.h1
m---------linux0
5 files changed, 7 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index a223b0a..c54743e 100755
--- a/Makefile
+++ b/Makefile
@@ -57,7 +57,7 @@ load:
prep:
sudo sh -c "echo 0 > /proc/sys/kernel/watchdog"
sudo cpupower frequency-set -d 3.7GHz -u 3.7GHz
- sudo sh -c "echo 1 > /proc/irq/127/smp_affinity"
+ sudo bash -c "for f in /proc/irq/*/smp_affinity; do echo 1 > \$$f 2>/dev/null; done"
util/%: util/%.c $(CACHEPC_UAPI)
diff --git a/cachepc/cachepc.c b/cachepc/cachepc.c
index 9aa2aa5..8a00ef1 100644
--- a/cachepc/cachepc.c
+++ b/cachepc/cachepc.c
@@ -161,7 +161,9 @@ cachepc_save_msrmts(struct cacheline *head)
do {
if (cl->first) {
BUG_ON(cl->cache_set >= L1_SETS);
- WARN_ON(cl->count > L1_ASSOC);
+ if (cl->count > L1_ASSOC)
+ CPC_ERR("Read count %llu for set %u line %u",
+ cl->count, cl->cache_set, cl->cache_line);
cachepc_msrmts[cl->cache_set] = cl->count;
} else {
BUG_ON(cl->count != 0);
diff --git a/cachepc/macro.S b/cachepc/macro.S
index 0025b0d..45a8121 100644
--- a/cachepc/macro.S
+++ b/cachepc/macro.S
@@ -2,8 +2,8 @@
# clobbers rax, rbx, rcx, rdx
.macro barrier
- lfence # memory barrier
- rdtsc # compiler barrier
+ mfence # memory barrier
+ rdtsc # serializing
.endm
# clobbers rax, rbx, rcx, rdx, (out)
diff --git a/cachepc/uapi.h b/cachepc/uapi.h
index 98898b8..04acf25 100644
--- a/cachepc/uapi.h
+++ b/cachepc/uapi.h
@@ -55,6 +55,7 @@ enum {
CPC_TRACK_FAULT_NO_RUN,
CPC_TRACK_EXEC,
CPC_TRACK_FULL,
+ CPC_TRACK_AUTO_FULL,
};
struct cpc_track_config {
diff --git a/linux b/linux
-Subproject af02fe2bb56116a018cf5d4838690224d3e2589
+Subproject eb72c0f78ddce1c340f2407a6f1fbcd511a05bb