Skip to content
This repository was archived by the owner on Feb 16, 2023. It is now read-only.

Commit c4dba4d

Browse files
author
Stephanie Labasan
committed
Minor fixes to msrmod:
- Adding some examples to the README - Correcting time window 2 in setting package power limit Signed-off-by: Stephanie Labasan <[email protected]>
1 parent 78ad210 commit c4dba4d

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

msrmod/README.md

+19
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
11
v0.0 alpha
22
This tool is in alpha and has not been fully tested. Additionally, updates will
33
be sparse.
4+
5+
EXAMPLES
6+
========
7+
To set a package-level power limit on socket 0 (add -v for a verbose print out):
8+
9+
./msrmod -s package -c 0 -a 100 -b 1 -e 120 -f 3 (-v)
10+
11+
To restore default power limits on socket 1:
12+
13+
./msrmod -s default -c 1
14+
15+
To see current package-level and dram-level power limits:
16+
17+
./msrmod -p rapl
18+
19+
To explicitly write a new hex value into register MSR_PKG_POWER_LIMIT 0x610 on
20+
CPU 3 (i.e., socket 0):
21+
22+
./msrmod -w 610 -t 3 -d 7845000158320

msrmod/msrmod.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ int set_functions(char *type, int socket, double watts1, double seconds1, double
159159
socketlim2.seconds = 0;
160160

161161
socketlim.watts = watts1;
162-
socketlim.seconds = seconds2;
162+
socketlim.seconds = seconds1;
163163
if (ISVERBOSE)
164164
{
165165
fprintf(stdout, "\n=== Socket %d ===\n", socket);
@@ -434,7 +434,7 @@ int main(int argc, char **argv)
434434
return -1;
435435
}
436436
write_msr_by_idx(thread, msr, msr_data);
437-
fprintf(stdout, "Writing %lx to MSR 0x%lx on CPU %d\n", msr_data, msr, thread);
437+
fprintf(stdout, "Writing 0x%lx to MSR 0x%lx on CPU %d\n", msr_data, msr, thread);
438438
}
439439
else if (iswrite && !set_msr_data)
440440
{

0 commit comments

Comments
 (0)