felixge / felixge/pprofutils

"Bad line" error on an Android simpleperf trace

Đang mở
#3 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Go
Star
149
Fork
18
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Came across this trying to convert an android `simpleperf` trace to pprof:

I'll note the full repo steps here in case they're useful; they probably aren't though; the error message is probably sufficient:

```
$ git clone https://android.googlesource.com/platform/system/extras
$ cd extras/simpleperf/scripts
$ ./app_profiler.py -p com.google.android.apps.maps -r "-f 4000 -g -e cpu-clock --trace-offcpu --duration 60" --activity com.google.android.maps.MapsActivity --skip_collect_binaries
$ ./report_sample.py ~/simpleperf/perf.data | ~/FlameGraph/stackcollapse-perf.pl | ~/go/bin/text2pprof
```

Gives this error:

```
bad line: 6: "Binder:23281_1;__start_thread;__pthread_start;thread_data_t::trampoline;android::AndroidRuntime::javaThreadShell;android::Thread::_threadLoop;android::PoolThread::threadLoop;android::IPCThreadState::joinThreadPool;android::IPCThreadState::executeCommand;android::BBinder::transact;JavaBBinder::onTransact;_JNIEnv::CallBooleanMethod;art::JNI::CallBooleanMethodV;art::JValue art::InvokeVirtualOrInterfaceWithVarArgs 6"
```

This happens on line 6... let's look at the first 10 lines:

```
./report_sample.py ~/simpleperf/perf.data | ~/FlameGraph/stackcollapse-perf.pl | head
Binder:23281_1;__start_thread;__pthread_start;thread_data_t::trampoline;android::AndroidRuntime::javaThreadShell;android::Thread::_threadLoop;android::PoolThread::threadLoop;android::IPCThreadState::joinThreadPool 11
Binder:23281_1;__start_thread;__pthread_start;thread_data_t::trampoline;android::AndroidRuntime::javaThreadShell;android::Thread::_threadLoop;android::PoolThread::threadLoop;android::IPCThreadState::joinThreadPool;@plt 6
Binder:23281_1;__start_thread;__pthread_start;thread_data_t::trampoline;android::AndroidRuntime::javaThreadShell;android::Thread::_threadLoop;android::PoolThread::threadLoop;android::IPCThreadState::joinThreadPool;@plt;work_pending;do_notify_resume;__schedule;__schedule 3
Binder:23281_1;__start_thread;__pthread_start;thread_data_t::trampoline;android::AndroidRuntime::javaThreadShell;android::Thread::_threadLoop;android::PoolThread::threadLoop;android::IPCThreadState::joinThreadPool;android::IPCThreadState::executeCommand 10
Binder:23281_1;__start_thread;__pthread_start;thread_data_t::trampoline;android::AndroidRuntime::javaThreadShell;android::Thread::_threadLoop;android::PoolThread::threadLoop;android::IPCThreadState::joinThreadPool;android::IPCThreadState::executeCommand;android::BBinder::transact 1
Binder:23281_1;__start_thread;__pthread_start;thread_data_t::trampoline;android::AndroidRuntime::javaThreadShell;android::Thread::_threadLoop;android::PoolThread::threadLoop;android::IPCThreadState::joinThreadPool;android::IPCThreadState::executeCommand;android::BBinder::transact;JavaBBinder::onTransact;_JNIEnv::CallBooleanMethod;art::JNI::CallBooleanMethodV 2
Binder:23281_1;__start_thread;__pthread_start;thread_data_t::trampoline;android::AndroidRuntime::javaThreadShell;android::Thread::_threadLoop;android::PoolThread::threadLoop;android::IPCThreadState::joinThreadPool;android::IPCThreadState::executeCommand;android::BBinder::transact;JavaBBinder::onTransact;_JNIEnv::CallBooleanMethod;art::JNI::CallBooleanMethodV;art::JValue art::InvokeVirtualOrInterfaceWithVarArgs 6
Binder:23281_1;__start_thread;__pthread_start;thread_data_t::trampoline;android::AndroidRuntime::javaThreadShell;android::Thread::_threadLoop;android::PoolThread::threadLoop;android::IPCThreadState::joinThreadPool;android::IPCThreadState::executeCommand;android::BBinder::transact;JavaBBinder::onTransact;_JNIEnv::CallBooleanMethod;art::JNI::CallBooleanMethodV;art::JValue art::InvokeVirtualOrInterfaceWithVarArgs;art_quick_invoke_stub;android.os.Binder.execTransact 2
Binder:23281_1;__start_thread;__pthread_start;thread_data_t::trampoline;android::AndroidRuntime::javaThreadShell;android::Thread::_threadLoop;android::PoolThread::threadLoop;android::IPCThreadState::joinThreadPool;android::IPCThreadState::executeCommand;android::BBinder::transact;JavaBBinder::onTransact;_JNIEnv::CallBooleanMethod;art::JNI::CallBooleanMethodV;art::JValue art::InvokeVirtualOrInterfaceWithVarArgs;art_quick_invoke_stub;android.os.Binder.execTransact;android.os.Binder.execTransactInternal 2
Binder:23281_1;__start_thread;__pthread_start;thread_data_t::trampoline;android::AndroidRuntime::javaThreadShell;android::Thread::_threadLoop;android::PoolThread::threadLoop;android::IPCThreadState::joinThreadPool;android::IPCThreadState::executeCommand;android::BBinder::transact;JavaBBinder::onTransact;_JNIEnv::CallBooleanMethod;art::JNI::CallBooleanMethodV;art::JValue art::InvokeVirtualOrInterfaceWithVarArgs;art_quick_invoke_stub;android.os.Binder.execTransact;android.os.Binder.execTransactInternal;ExecuteNterpImpl 1
```

At a guess, I'd say the problem is probably the space in between `JValue art`.

It's very possible that I'm holding this wrong and there shouldn't be spaces in these lines according to the format? However perhaps there is a way to 'greedily' consume forward till we get to the numbers, perhaps?

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.