1、CameraService進(jìn)程信息打印
adb shell dumpsys media.camera
可以獲取設(shè)計(jì)的相機(jī)相關(guān)信息及狀態(tài)
CameraService Log等級(jí)修改
adb shell dumpsys media.camera -v 1
代碼入口是:
frameworks\native\cmds\dumpsys\main.cpp
int main(int argc, char* const argv[]) {
? ? signal(SIGPIPE, SIG_IGN);
? ? sp<IServiceManager> sm = defaultServiceManager();
? ? fflush(stdout);
? ? if (sm == nullptr) {
? ? ? ? ALOGE("Unable to get default service manager!");
? ? ? ? aerr << "dumpsys: Unable to get default service manager!" << endl;
? ? ? ? return 20;
? ? }
? ? Dumpsys dumpsys(sm.get());
? ? return dumpsys.main(argc, argv);
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
frameworks\native\cmds\dumpsys\dumpsys.cpp
int Dumpsys::main(int argc, char* const argv[]) {
? ? Vector<String16> services;
? ? Vector<String16> args;
? ? ....
? ? for (size_t i = 0; i < N; i++) {
? ? ? ? String16 service_name = std::move(services[i]);
? ? ? ? if (IsSkipped(skippedServices, service_name)) continue;
? ? ? ? sp<IBinder> service = sm_->checkService(service_name);
? ? ? ? if (service != nullptr) {
? ? ? ? ? ? ....
? ? ? ? ? ? // dump blocks until completion, so spawn a thread..
? ? ? ? ? ? std::thread dump_thread([=, remote_end { std::move(remote_end) }]() mutable {
? ? ? ? ? ? ? ? int err = service->dump(remote_end.get(), args);
? ? ? ? ? ? });
? ? ? ? ...
? ? return 0;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
進(jìn)入CameraServic
frameworks\av\services\camera\libcameraservice\CameraService.cpp
status_t CameraService::dump(int fd, const Vector<String16>& args) {
? ? ...
? ? dprintf(fd, "\n== Service global info: ==\n\n");
? ? dprintf(fd, "Number of camera devices: %d\n", mNumberOfCameras);
? ? dprintf(fd, "Number of normal camera devices: %d\n", mNumberOfNormalCameras);
? ? String8 activeClientString = mActiveClientManager.toString();
? ? dprintf(fd, "Active Camera Clients:\n%s", activeClientString.string());
? ? dprintf(fd, "Allowed user IDs: %s\n", toString(mAllowedUsers).string());
? ...
}
1
2
3
4
5
6
7
8
9
10
11
2照棋、查看camera所在進(jìn)程及運(yùn)行在那個(gè)cpu上
ps –e | grep camera
ps -eo pid,args,psr|grep camera//run on which processor .
1
2
3资溃、kernel log抓热芏А:
adb logcat -b kernel -v threadtime > kernel.log
adb shell cat dev/kmsg | find “3641”//pid
adb logcat -b all > log//userspace and kernel space log
//main and kernel log
adb logcat -c && adb logcat -G 256M && adb logcat -b main -b crash -b kernel > log.txt
1
2
3
4
5
6
7
4梳庆、java層打印堆棧:
try{
throw new Exception();
} catch(Throwable e){
Log.e("sgj","e.printStackTrace();");
e.printStackTrace();
}
1
2
3
4
5
6
5膏执、執(zhí)行截圖命令:
adb shell /system/bin/screencap -p /sdcard/screenshot.png
adb pull /sdcard/screenshot.png d:/screenshot.png
1
2
6、查看進(jìn)程打開(kāi)的文件:
adb shell lsof -p 685 >e:\log.txt
1
7欺栗、addr2line工具
addr2line -C -f -e? newcdr 00026cb3
1
8征峦、內(nèi)存信息打印
adb shell dumpsys meminfo packagename
1
9、修改文件的讀寫(xiě)權(quán)限
chmod 777 build.prop
1
10类腮、patch添加
git apply –reject xx.patch
11蛉加、代碼上傳主干及分支
git push origin HEAD:refs/for/master
上傳分支
git push origin HEAD:refs/for/分支名
1
2
3
12针饥、shell 腳本開(kāi)關(guān)應(yīng)用
adb shell am start -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -n com.tencent.mobileqq/com.tencent.mobileqq.activity.SplashActivity
adb shell am start -n com.tencent.mobileqq/com.tencent.mobileqq.activity.SplashActivity
adb shell am force-stop com.some.package
1
2
3
13、sharedpreference數(shù)據(jù)保存位置:
/data/data/<packagename>/shared_prefs/name of sharedPreference
1
14筷凤、CPP文件中開(kāi)關(guān)log
打開(kāi)ALOGV: #define LOG_NDEBUG 0
打開(kāi)ALOGI:#define LOG_NIDEBUG 0
打開(kāi)ALOGD:#define LOG_NDDEBUG 0
打開(kāi)全部LOG:#undef NDEBUG
1
2
3
4
15藐守、qcom HAL3 log開(kāi)關(guān)
//打開(kāi)等級(jí)為L(zhǎng)EVEL: logInfoMask; GROUP: 0x80 即CamxLogGroupHAL LOG;
adb shell "echo logInfoMask=0x80 >> /vendor/etc/camera/camxoverridesettings.txt"
//打開(kāi)所有chi log蹂风,bit 0 - error, bit 1 - warning, bit 2 - info, bit 3 - debug
adb shell "echo overrideLogLevels =15>> /vendor/etc/camera/camxoverridesettings.txt"
//CamxLogGroupHAL定義在vendor\qcom\proprietary\camx\src\utils\camxtypes.h
//CamxLogInfo定義在vendor\qcom\proprietary\camx\src\utils\camxtypes.h
//默認(rèn)值定義在vendor\qcom\proprietary\camx\src\core\camxsettings.xml
//用戶重載在camxoverridesettings.txt和camxoverridesettingsprivate.txt
1
2
3
4
5
6
7
8
9
16、qcom hal3 kernel log 開(kāi)關(guān)
adb shell "echo 0x10 > /sys/module/cam_debug_util/parameters/debug_mdl"
1
17足淆、
x = (m+n-1)&~(n-1)
意思是:
x=m/n*n+(m%n==0)?0:n;
————————————————
版權(quán)聲明:本文為CSDN博主「gaojian.shi」的原創(chuàng)文章,遵循 CC 4.0 BY-SA 版權(quán)協(xié)議族奢,轉(zhuǎn)載請(qǐng)附上原文出處鏈接及本聲明丹鸿。
原文鏈接:https://blog.csdn.net/u010116586/article/details/92766257