Skip to content

Commit

Permalink
Add support to pmctrack
Browse files Browse the repository at this point in the history
  • Loading branch information
SimoneDutto committed Jul 4, 2020
1 parent 7cc7e86 commit ed6d5b0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion kernel_module/src/f_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <linux/string.h>
#include <linux/mutex.h>
#include <linux/random.h>
#include <linux/pmctrack.h>
#include <asm/errno.h>

#include "../include/f_list.h"
Expand All @@ -26,12 +27,18 @@ static LIST_HEAD(f_list);
static unsigned int* get_randoms(unsigned int id){
int i = 0;
unsigned int *fts = NULL;
uint64_t value;

fts = kzalloc(NUM*sizeof(unsigned int), GFP_KERNEL);
if(fts == NULL) return NULL;


for(i=0;i<NUM;i++){
get_random_bytes(&fts[i], sizeof(unsigned int));
//get_random_bytes(&fts[i], sizeof(unsigned int));
pmcs_get_current_metric_value(get_pid_task(find_get_pid(id),PIDTYPE_PID),\
0, &value);
fts[i] = (unsigned int) value;

}

return fts;
Expand Down

0 comments on commit ed6d5b0

Please sign in to comment.