summaryrefslogtreecommitdiffstats
path: root/kmod
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2022-08-13 20:59:43 +0200
committerLouis Burda <quent.burda@gmail.com>2022-08-13 20:59:43 +0200
commit2ee8bd2f14f1fe909108e89a24ec9f6de814f438 (patch)
tree19b34014a072a7cef3b5e797040076b620a46dc2 /kmod
parent476f6c892d90e66fbd17ba616b82b000a990f63e (diff)
downloadcachepc-2ee8bd2f14f1fe909108e89a24ec9f6de814f438.tar.gz
cachepc-2ee8bd2f14f1fe909108e89a24ec9f6de814f438.zip
Fixed counts read, added test for hwpf and disable attempts
Diffstat (limited to 'kmod')
-rwxr-xr-xkmod/cachepc.c5
-rwxr-xr-xkmod/cachepc.h2
2 files changed, 4 insertions, 3 deletions
diff --git a/kmod/cachepc.c b/kmod/cachepc.c
index 9c896f3..4e07f32 100755
--- a/kmod/cachepc.c
+++ b/kmod/cachepc.c
@@ -15,7 +15,6 @@ static cacheline *build_cache_ds(cache_ctx *ctx, cacheline **cacheline_ptr_arr);
static void build_randomized_list_for_cache_set(cache_ctx *ctx, cacheline **cacheline_ptr_arr);
static cacheline **allocate_cache_ds(cache_ctx *ctx);
static uint16_t get_virt_cache_set(cache_ctx *ctx, void *ptr);
-static void *aligned_alloc(size_t alignment, size_t size);
void
cachepc_init_pmc(uint8_t index, uint8_t event_no, uint8_t event_mask)
@@ -385,7 +384,7 @@ allocate_cache_ds(cache_ctx *ctx)
BUG_ON(ctx->addressing != VIRTUAL);
// For virtual addressing, allocating a consecutive chunk of memory is enough
- cl_arr = aligned_alloc(PAGE_SIZE, ctx->cache_size);
+ cl_arr = cachepc_aligned_alloc(PAGE_SIZE, ctx->cache_size);
BUG_ON(cl_arr == NULL);
for (i = 0; i < ctx->nr_of_cachelines; ++i) {
@@ -404,7 +403,7 @@ get_virt_cache_set(cache_ctx *ctx, void *ptr)
}
void *
-aligned_alloc(size_t alignment, size_t size)
+cachepc_aligned_alloc(size_t alignment, size_t size)
{
void *p;
diff --git a/kmod/cachepc.h b/kmod/cachepc.h
index 8a9521c..97746ec 100755
--- a/kmod/cachepc.h
+++ b/kmod/cachepc.h
@@ -16,6 +16,8 @@ void cachepc_release_ds(cache_ctx *ctx, cacheline *ds);
cacheline *cachepc_prepare_victim(cache_ctx *ctx, uint32_t set);
void cachepc_release_victim(cache_ctx *ctx, cacheline *ptr);
+void *cachepc_aligned_alloc(size_t alignment, size_t size);
+
void cachepc_save_msrmts(cacheline *head);
void cachepc_print_msrmts(cacheline *head);