NVIDIA Tegra
DRIVE 5.0 Linux Open Source Software

Development Guide
5.0.10.3 Release


 
EMC Log Utility
 
Usage and Options
Timing Parameters
The emc_log utility enables you to perform memory bandwidth analysis of the system. The utility performs statistical sampling of memory controller usage on a client-by-client basis and reports output via stdout. Tegra platforms provide two memory controller (MC) statistic counters and one embedded memory controller (EMC) counter. Software generally uses one of the MC counters and the EMC counter. If multiple clients are supplied, emc_log samples them two at a time, in round-robin order.
Usage and Options
The emc_log utility has the following basic usage:
emc_log [options]
The following table describes available options:
Option
Description
-group <group_name>
Collects statistics for all clients in <group_name>. If the group contains 2 or more clients, emc_log samples two clients at a time, in round robin order.
-client <client_name>
Collects statistics for the client two. Multiple ‑‑client options can be specified on the command line at once, but if more than two are specified the clients are sampled two at a time in a round robin order.
-window <ms>
Samples every <ms> milliseconds. Default is 1000.
-startdelay <s>
Delays for <s> seconds before sampling the counters. Default is 1.
-length <s>
Samples for at least <s> seconds. Default is 1.
-period <n>
Specifies the period a client is sampled in round-robin order. The default period is 1.
For example, if four clients and a period of 3 are specified, the sampling order is:
First sampling: Client 1 and Client 2
Second sampling: Client 1 and Client 2
Third sampling: Client 1 and Client 2
Fourth sampling: Client 3 and Client 4
Fifth sampling: Client 3 and Client 4
Sixth sampling: Client 3 and Client 4
Seventh sampling: Client 1 and Client 2.
-total
Collects total statistics for all clients specified.
-o <file_name>
If specified, outputs data to <file_name>, otherwise output data to stdout.
-help
Prints descriptions for supported command line options. Also lists all supported client names, client IDs, and group names on the platform.
Note: Clients and groups (listed in the table) are platform-specific. Enter emc_log help to obtain a listing of the supported groups and clients for your platform.
Timing Parameters
The emc_log timing parameters are described in the following diagram:
In the above figure, four clients are specified, and a period of 3 is specified. The start delay is 1 s.
To sample a group
Sample a group mpcore for 30 seconds with the following command:
emc_log -chip 0x18 -group mpcore -length 30
To sample an individual client
Sample a client nvdisplayr for 30 seconds with the following command:
emc_log -chip 0x18 -client nvdisplayr -length 30
To sample multiple clients
Sample the clients nvdisplayr and nvdisplayr1 for 30 seconds with the following command:
emc_log -chip 0x18 -client nvdisplayr -client nvdisplayr1 -length 30
The following code provides emc_log commands and output.
# emc_log -chip 0x18 -help
[77/1864]
emc_log version 2.0.0
CHIPID: TEGRA_CHIPID_TEGRA186
Usage: emc_log [-option]
Options:
-help : Print this help screen
-chip <chipid> : Specify the chip id, the supported chips are: 0x40, 0x13, 0x21 and 0x18. The option is required for chip 0x18
-group <groupName> : Collect stats for all clients in <groupName>
-client <clientName> : Collect stats for <clientName>
-window <int> : Sample every <int> ms, default = 1000 ms
-startdelay <int> : Delay sampling for <int> seconds (default = 1s)
-length <int> : Sample for at least <int> seconds (default = 10s)
-period <int> : Set the period for rescheduling
-mode <none/address/client> : Set the mode for rescheduling
-address_low <int> : Set the low address for address filtering
-address_length <int> : Set the total range of address for address filtering
-address_window_size <int> : Set the size of window for address filtering (address mode only)
-o <filename> : If specified, output data to this file. Otherwise, output data to stdout
-verbose : Print details from log buffer
-total : Collect the total stats for all clients specified
-debug : Print commands sent to sysfs
-slack_hi : Set the SLACK_LIMIT_HI
-slack_lo : Set the SLACK_LIMIT_LO
-stats <bw/expired/histo>: Select the statistics to be collected
More than one client / group can be specified at a time.
If more clients are specified than the hardware can sample
simultaneously, clients will be sampled in a round-robin order.
Group Client ID
ptc ptcr 0
afi afir 14
hda hdar 21
hc host1xdmar 22
nvenc nvencsrd 28
sata satar 31
mpcore mpcorer 39
nvenc nvencswr 43
afi afiw 49
hda hdaw 53
mpcore mpcorew 57
sata sataw 61
isp2 ispra 68
isp2 ispwa 70
isp2 ispwb 71
xusb_host xusb_hostr 74
xusb_host xusb_hostw 75
xusb_dev xusb_devr 76
xusb_dev xusb_devw 77
tsec tsecsrd 84
tsec tsecswr 85
gpu gpusrd 88
gpu gpuswr 89
sdmmc1a sdmmcra 96
sdmmc2a sdmmcraa 97
sdmmc3a sdmmcr 98
sdmmc4a sdmmcrab 99
sdmmc1a sdmmcwa 100
sdmmc2a sdmmcwaa 101
sdmmc3a sdmmcw 102
sdmmc4a sdmmcwab 103
vic vicsrd 108
vic vicswr 109
vi viw 114
nvdec nvdecsrd 120
nvdec nvdecswr 121
ape aper 122
ape apew 123
nvjpg nvjpgsrd 126
nvjpg nvjpgswr 127
se sesrd 128
se seswr 129
etr etrr 132
etr etrw 133
tsecb tsecsrdb 134
tsecb tsecswrb 135
gpu gpusrd2 136
gpu gpuswr2 137
axis axisr 140
axis axisw 141
eqos eqosr 142
eqos eqosw 143
ufshc ufshcr 144
ufshc ufshcw 145
nvdisplay nvdisplayr 146
bpmp bpmpr 147
bpmp bpmpw 148
bpmp bpmpdmar 149
bpmp bpmpdmaw 150
aon aonr 151
aon aonw 152
aon aondmar 153
aon aondmaw 154
sce scer 155
sce scew 156
sce scedmar 157
sce scedmaw 158
ape apedmar 159
ape apedmaw 160
nvdisplay nvdisplayr1 161
vic vicsrd1 162
nvdec nvdecsrd1 163
emc dram_stat_begin 165
dram activate_cnt 165
dram read_cnt 166
dram read8_cnt 167
dram write_cnt 168
dram write8_cnt 169
dram ref_cnt 170
dram extclks_cke_eq0_no_banks_active 171
dram clkstop_cke_eq0_no_banks_active 172
dram extclks_cke_eq1_no_banks_active 173
dram clkstop_cke_eq1_no_banks_active 174
dram extclks_cke_eq0_some_banks_active 175
dram clkstop_cke_eq0_some_banks_active 176
dram extclks_cke_eq1_some_banks_active 177
dram clkstop_cke_eq1_some_banks_active 178
dram sr_cke_eq0_clks 179
dram dsr 180
readtally 253
writetally 254
aggregate 255
==============================================================
emc_log -chip 0x18 -group mpcore
/emc_log version 2.0.0
CHIPID: TEGRA_CHIPID_TEGRA186
Delay sampling for 1 seconds...
Start sampling for 10 seconds...
debug_fs = /sys/kernel/debug
Duration(ms) Client ID Bandwidth(KBps)
1000 39 181273.093750
1000 57 164767.687500
1000 39 181272.203125
1000 57 164773.265625
1000 39 181252.015625
1000 57 164762.453125
1000 39 181229.359375
1000 57 164745.640625
1000 39 181245.625000
1000 57 164762.562500
1000 39 181219.078125
1000 57 164737.031250
1000 39 181261.812500
1000 57 164781.703125
1000 39 181275.265625
1000 57 164793.890625
1000 39 181292.203125
1000 57 164804.015625
==============================================================
emc_log -chip 0x18 -group nvdisplay
emc_log version 2.0.0
CHIPID: TEGRA_CHIPID_TEGRA186
Delay sampling for 1 seconds...
Start sampling for 10 seconds...
debug_fs = /sys/kernel/debug
Duration(ms) Client ID Bandwidth(KBps)
1000 146 0.000000
1000 161 0.000000
1000 146 0.000000
1000 161 0.000000
1000 146 0.000000
1000 161 0.000000
1000 146 0.000000
1000 161 0.000000
1000 146 0.000000
1000 161 0.000000
1000 146 0.000000
1000 161 0.000000
1000 146 0.000000
1000 161 0.000000
1000 146 0.000000
1000 161 0.000000
1000 146 0.000000
1000 161 0.000000
==============================================================
emc_log -chip 0x18 -client nvdisplayr
emc_log version 2.0.0
CHIPID: TEGRA_CHIPID_TEGRA186
Delay sampling for 1 seconds...
Start sampling for 10 seconds...
debug_fs = /sys/kernel/debug
Duration(ms) Client ID Bandwidth(KBps)
1000 146 0.000000
1000 146 0.000000
1000 146 0.000000
1000 146 0.000000
1000 146 0.000000
1000 146 0.000000
1000 146 0.000000
1000 146 0.000000
1000 146 0.000000