*
* @param strings Event names we will record.
*/
+ @VisibleForTesting
public static synchronized void setFilter(List<String> strings) {
sFilter = new LinkedList<String>(strings);
}
* Enable or disable perf tracing.
* Disabling of perf tracing will dump trace data to the system log.
*/
+ @VisibleForTesting
public static synchronized void setEnabled(boolean enabled) {
if (sEnabled == enabled) {
return;
*
* @param enabled Whether to enable memory tracking for all perf events.
*/
+ @VisibleForTesting
public static synchronized void setMemoryTrackingEnabled(boolean enabled) {
sTrackMemory = enabled;
}
*
* @param enabled Whether to enable timing tracking for all perf events.
*/
+ @VisibleForTesting
public static synchronized void setTimingTrackingEnabled(boolean enabled) {
sTrackTiming = enabled;
}
* It is safe to call trace methods without checking if PerfTraceEvent
* is enabled.
*/
+ @VisibleForTesting
public static synchronized boolean enabled() {
return sEnabled;
}
* Record an "begin" perf trace event.
* Begin trace events should have a matching end event.
*/
+ @VisibleForTesting
public static synchronized void begin(String name) {
final long eventId = name.hashCode();
TraceEvent.startAsync(name, eventId);
* time delta between begin and end is usually interesting to
* graph code.
*/
+ @VisibleForTesting
public static synchronized void end(String name) {
final long eventId = name.hashCode();
TraceEvent.finishAsync(name, eventId);
* Record an "begin" memory trace event.
* Begin trace events should have a matching end event.
*/
+ @VisibleForTesting
public static synchronized void begin(String name, MemoryInfo memoryInfo) {
final long eventId = name.hashCode();
TraceEvent.startAsync(name, eventId);
* memory usage delta between begin and end is usually interesting to
* graph code.
*/
+ @VisibleForTesting
public static synchronized void end(String name, MemoryInfo memoryInfo) {
final long eventId = name.hashCode();
TraceEvent.finishAsync(name, eventId);
* @param file Which file to append the performance data to. If {@code null}, the performance
* data will be sent to STDOUT.
*/
+ @VisibleForTesting
public static synchronized void setOutputFile(File file) {
sOutputFile = file;
}