From: Joel Fernandes Date: Fri, 2 Jun 2017 17:19:28 +0000 (-0700) Subject: atrace: Set saved_cmdline_size to 8192 X-Git-Tag: android-x86-9.0-r1~436^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=ed80bd04cc3bf80082b1d733ef06d90a29c6270a;p=android-x86%2Fframeworks-native.git atrace: Set saved_cmdline_size to 8192 This increases the size of the table tracking comms and pids and prevents overwriting them easily. Bug: 38167231 Change-Id: I69b9000e4f9d0c2c7969efd38e02d8c1bffdad5c Signed-off-by: Joel Fernandes --- diff --git a/cmds/atrace/atrace.cpp b/cmds/atrace/atrace.cpp index ca799c9436..eff7c9204b 100644 --- a/cmds/atrace/atrace.cpp +++ b/cmds/atrace/atrace.cpp @@ -218,6 +218,9 @@ static const char* k_traceClockPath = static const char* k_traceBufferSizePath = "buffer_size_kb"; +static const char* k_traceCmdlineSizePath = + "saved_cmdlines_size"; + static const char* k_tracingOverwriteEnablePath = "options/overwrite"; @@ -438,6 +441,12 @@ static bool setTraceBufferSizeKB(int size) return writeStr(k_traceBufferSizePath, str); } +// Set the default size of cmdline hashtable +static bool setCmdlineSize() +{ + return writeStr(k_traceCmdlineSizePath, "8192"); +} + // Set the clock to the best available option while tracing. Use 'boot' if it's // available; otherwise, use 'mono'. If neither are available use 'global'. // Any write to the trace_clock sysfs file will reset the buffer, so only @@ -755,6 +764,7 @@ static bool setUpTrace() ok &= setCategoriesEnableFromFile(g_categoriesFile); ok &= setTraceOverwriteEnable(g_traceOverwrite); ok &= setTraceBufferSizeKB(g_traceBufferSizeKB); + ok &= setCmdlineSize(); ok &= setClock(); ok &= setPrintTgidEnableIfPresent(true); ok &= setKernelTraceFuncs(g_kernelTraceFuncs);