mirror of
https://github.com/andreas-abel/nanoBench.git
synced 2026-01-06 04:10:56 +01:00
minor fix
This commit is contained in:
@@ -64,7 +64,7 @@ The config file contains the required information for configuring the programmab
|
||||
|
||||
The assembler code sequence may use and modify any general-purpose or vector registers (unless the `-loop` or `-no_mem` options are used), including the stack pointer. There is no need to restore the registers to their original values at the end.
|
||||
|
||||
R14, RDI, RSI, RSP, and RBP are initialized with addresses in the middle of dedicated physically-contiguous memory areas (of 1 MB each), that can be freely modified by the assembler code. When using the kernel module, the size of the memory area that R14 points to can be increased using the `set-R14-size.sh` script; more details on this can be found [here](tools/CacheAnalyzer#prerequisites).
|
||||
R14, RDI, RSI, RSP, and RBP are initialized with addresses in the middle of dedicated memory areas (of 1 MB each), that can be freely modified by the assembler code. When using the kernel module, the size of the memory area that R14 points to can be increased using the `set-R14-size.sh` script; more details on this can be found [here](tools/CacheAnalyzer#prerequisites).
|
||||
|
||||
All other registers have initially undefined values. They can, however, be initialized as shown in the following example.
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ void parse_counter_configs() {
|
||||
continue;
|
||||
}
|
||||
|
||||
pfc_configs[n_pfc_configs].invalid = 0;
|
||||
pfc_configs[n_pfc_configs] = (struct pfc_config){0};
|
||||
|
||||
char* config_str = strsep(&line, " \t");
|
||||
|
||||
|
||||
@@ -130,9 +130,12 @@ static ssize_t config_show(struct kobject *kobj, struct kobj_attribute *attr, ch
|
||||
ssize_t count = 0;
|
||||
for (int i=0; i<n_pfc_configs; i++) {
|
||||
if (is_Intel_CPU) {
|
||||
count += sprintf(&(buf[count]), "%02lx.%02lx %s\n", pfc_configs[i].evt_num, pfc_configs[i].umask, pfc_configs[i].description);
|
||||
count += snprintf(&(buf[count]), PAGE_SIZE-count, "%02lx.%02lx %s\n", pfc_configs[i].evt_num, pfc_configs[i].umask, pfc_configs[i].description);
|
||||
} else {
|
||||
count += sprintf(&(buf[count]), "%03lx.%02lx %s\n", pfc_configs[i].evt_num, pfc_configs[i].umask, pfc_configs[i].description);
|
||||
count += snprintf(&(buf[count]), PAGE_SIZE-count, "%03lx.%02lx %s\n", pfc_configs[i].evt_num, pfc_configs[i].umask, pfc_configs[i].description);
|
||||
}
|
||||
if (count > PAGE_SIZE) {
|
||||
return PAGE_SIZE-1;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
|
||||
Reference in New Issue
Block a user