Created
February 28, 2024 13:33
-
-
Save aclamk/a27139230f349acd49b63e42f29eb32f to your computer and use it in GitHub Desktop.
objdump -d -r -S -C ./src/common/CMakeFiles/common-common-objs.dir/mempool.cc.o
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void mempool::pool_t::adjust_count(ssize_t items, ssize_t bytes) | |
{ | |
530: 41 55 push %r13 | |
532: 49 89 f5 mov %rsi,%r13 | |
535: 41 54 push %r12 | |
537: 49 89 d4 mov %rdx,%r12 | |
53a: 55 push %rbp | |
53b: 48 89 fd mov %rdi,%rbp | |
53e: 53 push %rbx | |
53f: 48 83 ec 08 sub $0x8,%rsp | |
thread_shard_index = (thread_shard_index == num_shards) ? pick_a_shard_int() : thread_shard_index; | |
543: 48 8d 3d 00 00 00 00 lea 0x0(%rip),%rdi # 54a <mempool::pool_t::adjust_count(long, long)+0x1a> | |
546: R_X86_64_TLSLD thread_shard_index-0x4 | |
54a: e8 00 00 00 00 call 54f <mempool::pool_t::adjust_count(long, long)+0x1f> | |
54b: R_X86_64_PLT32 __tls_get_addr-0x4 | |
54f: 48 8b 98 00 00 00 00 mov 0x0(%rax),%rbx | |
552: R_X86_64_DTPOFF32 thread_shard_index | |
556: 48 83 fb 20 cmp $0x20,%rbx | |
55a: 75 17 jne 573 <mempool::pool_t::adjust_count(long, long)+0x43> | |
void adjust_count(ssize_t items, ssize_t bytes); | |
static size_t pick_a_shard_int() { | |
// Dirt cheap, see: | |
// https://fossies.org/dox/glibc-2.32/pthread__self_8c_source.html | |
size_t me = (size_t)pthread_self(); | |
55c: e8 00 00 00 00 call 561 <mempool::pool_t::adjust_count(long, long)+0x31> | |
55d: R_X86_64_PLT32 pthread_self-0x4 | |
size_t i = (me >> CEPH_PAGE_SHIFT) & ((1 << num_shard_bits) - 1); | |
561: 48 8b 15 00 00 00 00 mov 0x0(%rip),%rdx # 568 <mempool::pool_t::adjust_count(long, long)+0x38> | |
564: R_X86_64_REX_GOTPCRELX ceph::_page_shift-0x4 | |
568: 8b 0a mov (%rdx),%ecx | |
56a: 48 d3 e8 shr %cl,%rax | |
56d: 83 e0 1f and $0x1f,%eax | |
570: 48 89 c3 mov %rax,%rbx | |
573: 48 8d 3d 00 00 00 00 lea 0x0(%rip),%rdi # 57a <mempool::pool_t::adjust_count(long, long)+0x4a> | |
576: R_X86_64_TLSLD thread_shard_index-0x4 | |
57a: e8 00 00 00 00 call 57f <mempool::pool_t::adjust_count(long, long)+0x4f> | |
57b: R_X86_64_PLT32 __tls_get_addr-0x4 | |
57f: 48 89 98 00 00 00 00 mov %rbx,0x0(%rax) | |
582: R_X86_64_DTPOFF32 thread_shard_index | |
{ return __atomic_add_fetch(&_M_i, __i, int(memory_order_seq_cst)); } | |
586: 48 c1 e3 07 shl $0x7,%rbx | |
58a: 48 01 eb add %rbp,%rbx | |
58d: f0 4c 01 6b 08 lock add %r13,0x8(%rbx) | |
592: 48 8b 80 00 00 00 00 mov 0x0(%rax),%rax | |
595: R_X86_64_DTPOFF32 thread_shard_index | |
599: 48 c1 e0 07 shl $0x7,%rax | |
59d: 48 01 c5 add %rax,%rbp | |
5a0: f0 4c 01 65 00 lock add %r12,0x0(%rbp) | |
shard[thread_shard_index].items += items; | |
shard[thread_shard_index].bytes += bytes; | |
} | |
5a5: 48 83 c4 08 add $0x8,%rsp | |
5a9: 5b pop %rbx | |
5aa: 5d pop %rbp | |
5ab: 41 5c pop %r12 | |
5ad: 41 5d pop %r13 | |
5af: c3 ret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From GDB | |
(gdb) disass 0xe40ae0 | |
Dump of assembler code for function mempool::pool_t::adjust_count(long, long): | |
0x0000000000e40ae0 <+0>: push %r13 | |
0x0000000000e40ae2 <+2>: mov %rsi,%r13 | |
0x0000000000e40ae5 <+5>: push %r12 | |
0x0000000000e40ae7 <+7>: mov %rdx,%r12 | |
0x0000000000e40aea <+10>: push %rbp | |
0x0000000000e40aeb <+11>: mov %rdi,%rbp | |
0x0000000000e40aee <+14>: push %rbx | |
0x0000000000e40aef <+15>: sub $0x8,%rsp | |
0x0000000000e40af3 <+19>: data16 data16 data16 mov %fs:0x0,%rax | |
0x0000000000e40aff <+31>: mov -0x2c70(%rax),%rbx | |
0x0000000000e40b06 <+38>: cmp $0x20,%rbx | |
0x0000000000e40b0a <+42>: jne 0xe40b23 <mempool::pool_t::adjust_count(long, long)+67> | |
0x0000000000e40b0c <+44>: callq 0x5e76f0 <pthread_self@plt> | |
0x0000000000e40b11 <+49>: lea 0xd71a18(%rip),%rdx # 0x1bb2530 <_ZN4ceph11_page_shiftE> | |
0x0000000000e40b18 <+56>: mov (%rdx),%ecx | |
0x0000000000e40b1a <+58>: shr %cl,%rax | |
0x0000000000e40b1d <+61>: and $0x1f,%eax | |
0x0000000000e40b20 <+64>: mov %rax,%rbx | |
0x0000000000e40b23 <+67>: data16 data16 data16 mov %fs:0x0,%rax | |
0x0000000000e40b2f <+79>: mov %rbx,-0x2c70(%rax) | |
0x0000000000e40b36 <+86>: shl $0x7,%rbx | |
0x0000000000e40b3a <+90>: add %rbp,%rbx | |
0x0000000000e40b3d <+93>: lock add %r13,0x8(%rbx) | |
0x0000000000e40b42 <+98>: mov -0x2c70(%rax),%rax | |
0x0000000000e40b49 <+105>: shl $0x7,%rax | |
0x0000000000e40b4d <+109>: add %rax,%rbp | |
0x0000000000e40b50 <+112>: lock add %r12,0x0(%rbp) | |
0x0000000000e40b55 <+117>: add $0x8,%rsp | |
0x0000000000e40b59 <+121>: pop %rbx | |
0x0000000000e40b5a <+122>: pop %rbp | |
0x0000000000e40b5b <+123>: pop %r12 | |
0x0000000000e40b5d <+125>: pop %r13 | |
0x0000000000e40b5f <+127>: retq | |
End of assembler dump. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment