Skip to content

Instantly share code, notes, and snippets.

@etaf
etaf / make_verbose.sh
Created May 18, 2020 04:20
make verbose
export VERBOSE=1
make
@etaf
etaf / arm_fp_stacktrace.txt
Last active May 14, 2020 05:46
arm framepointer stacktrace
prologue:
mov ip, sp
stmdb sp!, {fp, ip, lr, pc}
sub fp, ip, #4
epilogue:
ldm sp, {fp, sp, pc}
======
==stack====
@etaf
etaf / find_threads_of_process.sh
Created May 9, 2020 02:45
find_threads_of_process
ps -t <pid>
@etaf
etaf / get_cpu_core_id.c
Created May 8, 2020 11:55
get_cpu_core_id.c
//...
#include <sys/syscall.h>
//...
int getCpuId() {
unsigned cpu;
if (syscall(__NR_getcpu, &cpu, NULL, NULL) < 0) {
return -1;
} else {
return (int) cpu;
@etaf
etaf / performance_tool_list.txt
Last active May 11, 2020 03:52
performance tools
perf:
https://github.com/KDAB/hotspot
gperftools:
https://github.com/gperftools/gperftools
cpp opt note:
https://github.com/facontidavide/CPP_Optimizations_Diary
online benchmark:
@etaf
etaf / linux-trace-pint
Created April 1, 2020 05:29
linux trace point
ls /sys/kernel/debug/tracing
@etaf
etaf / gist:727ec4601774941bfc555f759bc379be
Created March 17, 2020 06:31
android_get_touch_coordinate
adb shell getevent | awk '{print $0,strtonum("0x" $NF)}'
# or
adb shell getevent | awk '{ if($3 == "0035" || $3 == "0036" ) print $0,strtonum("0x" $4)}'
@etaf
etaf / search_git_history
Created March 11, 2020 09:09
search in git history
# search by comment string
git log --grep="hello world"
# search commit modify a specific file
git log --stat -p <file_path>
@etaf
etaf / simpleperf
Created February 6, 2020 07:42
simpleperf
python3 app_profiler.py -p com.example.com -lib ./symbols -r " -f 2000 -g --duration 2.5 --post-unwind=yes" --ndk_path ./android-ndk-r20
@etaf
etaf / read_dyn_syms
Created January 21, 2020 02:07
read dynamic symbol table
arm-linux-androideabi-readelf --dyn-syms -W mylib.so
# -W: --wide , allow output width to execeed 80 chars.