You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CMP s2, s1 s1 - s2 compare
cmpb compare byte
cmpw compare word
cmpl compare double word
TEST s2, s1 s1 & s2
testb test byte
testw test word
testl test double word
# 如果 %eax 为零则跳转
TEST %eax, %eax
JE 400e77 <phase_1+0x23>
#!/usr/bin/envbpftraceBEGIN
{
printf("Tracing redis-server function \"getMaxmemoryState\" as inlined into \"performEvictions\".\n");
printf("NOTE: These instrumentation points are from disassembly of the redis-server build:\n");
printf(" SHA1: 25a228b839a93a1395907a03f83e1eee448b0f14\n");
printf(" Build-id: 2fc7c1a80ad026179178fff7045bc7fb4ad3f82d\n");
printf(" Version string: Redis server v=6.2.6 sha=4930d19e:1 malloc=jemalloc-5.1.0 bits=64 build=aa3ee5297f58e2\n");
printf("\n");
// Disable to only show the mem_tofree results and histograms.// Enable to also show intermediate variables.
@debug_mode=0;
print(@debug_mode);
printf("\n");
printf("%-6s %-6s %-20s %s\n", "PID", "TID", "COMM", "Event details");
}
interval:s:3
{
printf("Exiting after reaching duration limit.");
exit();
}
interval:s:1
{
printf("Per-second summary histograms:\n\n");
print(@maxmemory_mb_lhist);
print(@mem_reported_mb_lhist);
print(@mem_overhead_hist);
print(@mem_used_mb_lhist);
print(@mem_tofree_hist);
clear(@maxmemory_mb_lhist);
clear(@mem_reported_mb_lhist);
clear(@mem_overhead_hist);
clear(@mem_used_mb_lhist);
clear(@mem_tofree_hist);
}
uprobe:/opt/gitlab/embedded/bin/redis-server:0x11b0b9
{
// At address 0x11b0b9, register rax has the result of "zmalloc_used_memory" (line 379) as type size_t (uint64).$val=reg("ax");
@mem_reported[tid] =$val;
@mem_reported_mb_lhist[tid] =lhist($val / 1048576, 59000, 62000, 10);
if (@debug_mode==1) {
printf("%-6d %-6d %-20s line 379: %llu = zmalloc_used_memory\n", pid, tid, comm, $val);
}
}
资料
(concept:: Constant integer data)
register
Memory
Moving Data
Arithmetic operations
(concept:: Memory Addressing Modes )
(concept:: Address Computation Instruction )
例子
条件语句
(concept ::set 指令 )
jump 指令
未完待续
反汇编工具
指针和引用的反汇编
栈空间保存了该地址
。this 指针
rdi寄存器保存了对象的首地址,并以寄存器传参的方式传递到成员函数中
。虚函数
第一段程序的反汇编
寄存器
caller save
callee save
函数栈
Main()==>FunA()==>FunB() 调用为例
(concept:: 栈布局)
ebpf 来监控 redis 内存分配的的例子
#assembly #type/ebpf #type/system #objdump #public
The text was updated successfully, but these errors were encountered: