Skip to content

Commit afad6cc

Browse files
committed
Clarify --cpu-mask option values
Clarify that the --cpu-mask option reads values from left to right and modify the example in the description so it's clearer.
1 parent 73d8eac commit afad6cc

File tree

6 files changed

+20
-16
lines changed

6 files changed

+20
-16
lines changed

USAGE_android.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -759,9 +759,10 @@ optional arguments:
759759
by <file>
760760
--cpu-mask <binary-mask>
761761
Set of CPU cores used by the replayer.
762-
`binary-mask` is a succession of '0' and '1' that specifies
763-
used/unused cores. For example '1010' activates the first and
764-
third cores and deactivate all other cores.
762+
`binary-mask` is a succession of '0' and '1' read from left
763+
to right that specifies used/unused cores.
764+
For example '10010' activates the first and
765+
fourth cores and deactivate all other cores.
765766
If the option is not set, all cores can be used. If the option
766767
is set only for some cores, the other cores are not used.
767768
--screenshot-all

USAGE_desktop_D3D12.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,10 @@ Optional arguments:
273273
Direct3D 12 capture.
274274
--cpu-mask <binary-mask>
275275
Set of CPU cores used by the replayer.
276-
`binary-mask` is a succession of '0' and '1' that specifies
277-
used/unused cores. For example '1010' activates the first and
278-
third cores and deactivate all other cores.
276+
`binary-mask` is a succession of '0' and '1' read from left
277+
to right that specifies used/unused cores.
278+
For example '10010' activates the first and
279+
fourth cores and deactivate all other cores.
279280
If the option is not set, all cores can be used. If the option
280281
is set only for some cores, the other cores are not used.
281282
--gpu <index> Use the specified device for replay, where index

USAGE_desktop_Vulkan.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -593,9 +593,10 @@ Optional arguments:
593593
--log-debugview Log messages with OutputDebugStringA. Windows only.
594594
--cpu-mask <binary-mask>
595595
Set of CPU cores used by the replayer.
596-
`binary-mask` is a succession of '0' and '1' that specifies
597-
used/unused cores. For example '1010' activates the first and
598-
third cores and deactivate all other cores.
596+
`binary-mask` is a succession of '0' and '1' read from left
597+
to right that specifies used/unused cores.
598+
For example '10010' activates the first and
599+
fourth cores and deactivate all other cores.
599600
If the option is not set, all cores can be used. If the option
600601
is set only for some cores, the other cores are not used.
601602
--gpu <index> Use the specified device for replay, where index

android/scripts/gfxrecon.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def CreateReplayParser():
9595
parser.add_argument('--log-file', metavar='DEVICE_FILE', help='Write log messages to a file at the specified path instead of logcat (forwarded to replay tool)')
9696
parser.add_argument('--pause-frame', metavar='N', help='Pause after replaying frame number N (forwarded to replay tool)')
9797
parser.add_argument('--paused', action='store_true', default=False, help='Pause after replaying the first frame (same as "--pause-frame 1"; forwarded to replay tool)')
98-
parser.add_argument('--cpu-mask', metavar='binary_mask', help='Set of CPU cores used by the replayer. `binary-mask` is a succession of "0" and "1" that specifies used/unused cores. For example "1010" activates the first and third cores and deactivate all other cores. If the option is not set, all cores can be used. If the option is set only for some cores, the other cores are not used. (forwarded to replay tool)')
98+
parser.add_argument('--cpu-mask', metavar='binary_mask', help='Set of CPU cores used by the replayer. `binary-mask` is a succession of "0" and "1" that specifies used/unused cores read from left to right. For example "10010" activates the first and fourth cores and deactivate all other cores. If the option is not set, all cores can be used. If the option is set only for some cores, the other cores are not used. (forwarded to replay tool)')
9999
parser.add_argument('--screenshot-all', action='store_true', default=False, help='Generate screenshots for all frames. When this option is specified, --screenshots is ignored (forwarded to replay tool)')
100100
parser.add_argument('--screenshots', metavar='RANGES', help='Generate screenshots for the specified frames. Target frames are specified as a comma separated list of frame ranges. A frame range can be specified as a single value, to specify a single frame, or as two hyphenated values, to specify the first and last frames to process. Frame ranges should be specified in ascending order and cannot overlap. Note that frame numbering is 1-based (i.e. the first frame is frame 1). Example: 200,301-305 will generate six screenshots (forwarded to replay tool)')
101101
parser.add_argument('--screenshot-format', metavar='FORMAT', choices=['bmp', 'png'], help='Image file format to use for screenshot generation. Available formats are: bmp, png (forwarded to replay tool)')

framework/util/platform.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ inline std::string GetCpuAffinity()
623623
std::string affinity;
624624

625625
#ifdef __linux__
626-
cpu_set_t mask;
626+
cpu_set_t mask;
627627
if (sched_getaffinity(0, sizeof(mask), &mask))
628628
{
629629
return affinity;
@@ -638,7 +638,7 @@ inline std::string GetCpuAffinity()
638638
{
639639
affinity.pop_back();
640640
}
641-
#endif
641+
#endif // __linux__
642642

643643
return affinity;
644644
}
@@ -661,7 +661,7 @@ static bool SetCpuAffinity(const std::string& affinity)
661661
}
662662

663663
return (sched_setaffinity(0, sizeof(mask), &mask) == 0);
664-
#else
664+
#else // !__linux__
665665
return false;
666666
#endif
667667
}

tools/replay/replay_settings.h

+4-3
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,10 @@ static void PrintUsage(const char* exe_name)
163163
GFXRECON_WRITE_CONSOLE(" \t\tDirect3D 12 capture.");
164164
GFXRECON_WRITE_CONSOLE(" --cpu-mask <binary-mask>");
165165
GFXRECON_WRITE_CONSOLE(" \t\tSet of CPU cores used by the replayer.");
166-
GFXRECON_WRITE_CONSOLE(" \t\t`binary-mask` is a succession of '0' and '1' that specifies");
167-
GFXRECON_WRITE_CONSOLE(" \t\tused/unused cores. For example '1010' activates the first and");
168-
GFXRECON_WRITE_CONSOLE(" \t\tthird cores and deactivate all other cores.");
166+
GFXRECON_WRITE_CONSOLE(" \t\t`binary-mask` is a succession of '0' and '1' read from left to right");
167+
GFXRECON_WRITE_CONSOLE(" \t\tthat specifies used/unused cores.");
168+
GFXRECON_WRITE_CONSOLE(" \t\tFor example '10010' activates the first and");
169+
GFXRECON_WRITE_CONSOLE(" \t\tfourth cores and deactivate all other cores.");
169170
GFXRECON_WRITE_CONSOLE(" \t\tIf the option is not set, all cores can be used. If the option");
170171
GFXRECON_WRITE_CONSOLE(" \t\tis set only for some cores, the other cores are not used.");
171172
GFXRECON_WRITE_CONSOLE(" --gpu <index>\t\tUse the specified device for replay, where index");

0 commit comments

Comments
 (0)