1 /* 2 * Copyright (C) 2016 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.tradefed.profiler.recorder; 18 19 import java.util.Map; 20 21 /** 22 * A representation of an output line from /d/tracing/trace. 23 */ 24 public class TraceLine { 25 26 public static final String TAG_TASK = "TASK"; 27 public static final String TAG_CORE_NUM = "CPU#"; 28 public static final String TAG_IRQS_OFF = "IRQS-OFF"; 29 public static final String TAG_NEED_RESCHED = "NEED-RESCHED"; 30 public static final String TAG_HARD_IRQ = "HARDIRQ"; 31 public static final String TAG_PREEMPT_DELAY = "PREEMPT-DELAY"; 32 public static final String TAG_TIMESTAMP = "TIMESTAMP"; 33 public static final String TAG_FUNCTION = "FUNCTION"; 34 35 private String mTaskName; 36 private int mCoreNum; 37 private boolean mIrqsOff; 38 private boolean mNeedsResched; 39 private boolean mHardIrq; 40 private int mPreemptDelay; 41 private double mTimestamp; 42 private String mFunctionName; 43 private Map<String, Long> mFunctionParams; 44 45 public String getTaskName() { 46 return mTaskName; 47 } 48 49 public int getCoreNum() { 50 return mCoreNum; 51 } 52 53 public boolean getIrqsOff() { 54 return mIrqsOff; 55 } 56 57 public boolean getNeedsResched() { 58 return mNeedsResched; 59 } 60 61 public boolean getHardIrq() { 62 return mHardIrq; 63 } 64 65 public int getPreemptDelay() { 66 return mPreemptDelay; 67 } 68 69 public double getTimestamp() { 70 return mTimestamp; 71 } 72 73 public String getFunctionName() { 74 return mFunctionName; 75 } 76 77 public Map<String, Long> getFunctionParams() { 78 return mFunctionParams; 79 } 80 81 public void setTaskName(String taskName) { 82 mTaskName = taskName; 83 } 84 85 public void setCoreNum(int coreNum) { 86 mCoreNum = coreNum; 87 } 88 89 public void setIrqsOff(boolean irqsOff) { 90 mIrqsOff = irqsOff; 91 } 92 93 public void setNeedsResched(boolean needsResched) { 94 mNeedsResched = needsResched; 95 } 96 97 public void setHardIrq(boolean hardIrq) { 98 mHardIrq = hardIrq; 99 } 100 101 public void setPreemptDelay(int preemptDelay) { 102 mPreemptDelay = preemptDelay; 103 } 104 105 public void setTimestamp(double timestamp) { 106 mTimestamp = timestamp; 107 } 108 109 public void setFunctionName(String functionName) { 110 mFunctionName = functionName; 111 } 112 113 public void setFunctionParams(Map<String, Long> functionParams) { 114 mFunctionParams = functionParams; 115 } 116 } 117