Percent | Source code & Disassembly of vmlinux for cycles (72 samples, percent: local period) --------------------------------------------------------------------------------------------------- : : : : Disassembly of section .text: : : ffffffff812cef20 : : new_sync_write(): : inc_syscr(current); : return ret; : } : : static ssize_t new_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos) : { 0.00 : ffffffff812cef20: callq ffffffff8103a8a0 <__fentry__> 0.00 : ffffffff812cef25: push %rbp 0.00 : ffffffff812cef26: mov %rdx,%r8 5.55 : ffffffff812cef29: mov %rsp,%rbp 0.00 : ffffffff812cef2c: push %r12 0.00 : ffffffff812cef2e: push %rbx 0.00 : ffffffff812cef2f: mov %rcx,%r12 0.00 : ffffffff812cef32: sub $0x68,%rsp : struct iovec iov = { .iov_base = (void __user *)buf, .iov_len = len }; 0.00 : ffffffff812cef36: mov %rdx,-0x70(%rbp) : iocb_flags(): : } : : static inline int iocb_flags(struct file *file) : { : int res = 0; : if (file->f_flags & O_APPEND) 0.00 : ffffffff812cef3a: mov 0x40(%rdi),%edx : new_sync_write(): : { 8.33 : ffffffff812cef3d: mov %rdi,%rbx : struct iovec iov = { .iov_base = (void __user *)buf, .iov_len = len }; 0.00 : ffffffff812cef40: mov %rsi,-0x78(%rbp) : iocb_flags(): 0.00 : ffffffff812cef44: mov %edx,%eax 0.00 : ffffffff812cef46: shr $0x6,%eax 0.00 : ffffffff812cef49: and $0x10,%eax : res |= IOCB_APPEND; : if (file->f_flags & O_DIRECT) : res |= IOCB_DIRECT; 0.00 : ffffffff812cef4c: mov %eax,%ecx 0.00 : ffffffff812cef4e: or $0x20000,%ecx 0.00 : ffffffff812cef54: test $0x40,%dh 6.94 : ffffffff812cef57: cmovne %ecx,%eax : if ((file->f_flags & O_DSYNC) || IS_SYNC(file->f_mapping->host)) 0.00 : ffffffff812cef5a: test $0x10,%dh 0.00 : ffffffff812cef5d: jne ffffffff812cef77 0.00 : ffffffff812cef5f: mov 0xd0(%rdi),%rcx 0.00 : ffffffff812cef66: mov (%rcx),%rcx 0.00 : ffffffff812cef69: mov 0x28(%rcx),%rsi 0.00 : ffffffff812cef6d: testb $0x10,0x50(%rsi) 13.89 : ffffffff812cef71: je ffffffff812cf04c : res |= IOCB_DSYNC; 0.00 : ffffffff812cef77: or $0x2,%eax : if (file->f_flags & __O_SYNC) : res |= IOCB_SYNC; 0.00 : ffffffff812cef7a: mov %eax,%ecx 0.00 : ffffffff812cef7c: or $0x4,%ecx 0.00 : ffffffff812cef7f: and $0x100000,%edx : file_write_hint(): : if (file->f_write_hint != WRITE_LIFE_NOT_SET) 0.00 : ffffffff812cef85: mov 0x34(%rbx),%edx : iocb_flags(): : res |= IOCB_SYNC; 0.00 : ffffffff812cef88: cmovne %ecx,%eax : file_write_hint(): : if (file->f_write_hint != WRITE_LIFE_NOT_SET) 0.00 : ffffffff812cef8b: test %edx,%edx 6.97 : ffffffff812cef8d: jne ffffffff812cf03c : return file_inode(file)->i_write_hint; 0.00 : ffffffff812cef93: mov 0x20(%rbx),%rdx 0.00 : ffffffff812cef97: movzbl 0x87(%rdx),%edx : get_current(): : : DECLARE_PER_CPU(struct task_struct *, current_task); : : static __always_inline struct task_struct *get_current(void) : { : return this_cpu_read_stable(current_task); 0.00 : ffffffff812cef9e: mov %gs:0x126c0,%rcx : get_current_ioprio(): : * If the calling process has set an I/O priority, use that. Otherwise, return : * the default I/O priority. : */ : static inline int get_current_ioprio(void) : { : struct io_context *ioc = current->io_context; 0.00 : ffffffff812cefa7: mov 0x860(%rcx),%rsi : : if (ioc) 0.00 : ffffffff812cefae: xor %ecx,%ecx 0.00 : ffffffff812cefb0: test %rsi,%rsi 0.00 : ffffffff812cefb3: je ffffffff812cefb9 : return ioc->ioprio; 0.00 : ffffffff812cefb5: movzwl 0x14(%rsi),%ecx : init_sync_kiocb(): : *kiocb = (struct kiocb) { 0.00 : ffffffff812cefb9: shl $0x10,%ecx 12.50 : ffffffff812cefbc: movzwl %dx,%edx 0.00 : ffffffff812cefbf: movq $0x0,-0x38(%rbp) 0.00 : ffffffff812cefc7: movq $0x0,-0x30(%rbp) 0.00 : ffffffff812cefcf: or %ecx,%edx 0.00 : ffffffff812cefd1: movq $0x0,-0x28(%rbp) 0.00 : ffffffff812cefd9: movq $0x0,-0x18(%rbp) 0.00 : ffffffff812cefe1: mov %rbx,-0x40(%rbp) 0.00 : ffffffff812cefe5: mov %eax,-0x20(%rbp) 6.93 : ffffffff812cefe8: mov %edx,-0x1c(%rbp) : new_sync_write(): : struct kiocb kiocb; : struct iov_iter iter; : ssize_t ret; : : init_sync_kiocb(&kiocb, filp); : kiocb.ki_pos = (ppos ? *ppos : 0); 0.00 : ffffffff812cefeb: test %r12,%r12 0.00 : ffffffff812cefee: je ffffffff812cf05b : iov_iter_init(&iter, WRITE, &iov, 1, len); 0.00 : ffffffff812ceff0: mov $0x1,%esi 0.00 : ffffffff812ceff5: lea -0x68(%rbp),%rdi 0.00 : ffffffff812ceff9: mov $0x1,%ecx 0.00 : ffffffff812ceffe: lea -0x78(%rbp),%rdx : kiocb.ki_pos = (ppos ? *ppos : 0); 0.00 : ffffffff812cf002: mov (%r12),%rax 0.00 : ffffffff812cf006: mov %rax,-0x38(%rbp) : iov_iter_init(&iter, WRITE, &iov, 1, len); 8.33 : ffffffff812cf00a: callq ffffffff814c45e0 : call_write_iter(): : return file->f_op->write_iter(kio, iter); 12.51 : ffffffff812cf00f: mov 0x28(%rbx),%rax 0.00 : ffffffff812cf013: lea -0x68(%rbp),%rsi 0.00 : ffffffff812cf017: lea -0x40(%rbp),%rdi 0.00 : ffffffff812cf01b: callq *0x28(%rax) : new_sync_write(): : : ret = call_write_iter(filp, &kiocb, &iter); : BUG_ON(ret == -EIOCBQUEUED); 0.00 : ffffffff812cf01e: cmp $0xfffffffffffffdef,%rax 0.00 : ffffffff812cf024: je ffffffff812cf089 : if (ret > 0 && ppos) 0.00 : ffffffff812cf026: test %rax,%rax 0.00 : ffffffff812cf029: jle ffffffff812cf033 : *ppos = kiocb.ki_pos; 0.00 : ffffffff812cf02b: mov -0x38(%rbp),%rdx 12.49 : ffffffff812cf02f: mov %rdx,(%r12) : return ret; : } 0.00 : ffffffff812cf033: add $0x68,%rsp 0.00 : ffffffff812cf037: pop %rbx 0.00 : ffffffff812cf038: pop %r12 0.00 : ffffffff812cf03a: pop %rbp 0.00 : ffffffff812cf03b: retq : ki_hint_validate(): : if (hint <= max_hint) 0.00 : ffffffff812cf03c: xor %ecx,%ecx 0.00 : ffffffff812cf03e: cmp $0xffff,%edx 0.00 : ffffffff812cf044: cmova %ecx,%edx 0.00 : ffffffff812cf047: jmpq ffffffff812cef9e : iocb_flags(): : if ((file->f_flags & O_DSYNC) || IS_SYNC(file->f_mapping->host)) 5.55 : ffffffff812cf04c: testb $0x1,0xc(%rcx) 0.00 : ffffffff812cf050: je ffffffff812cef7a 0.00 : ffffffff812cf056: jmpq ffffffff812cef77 : new_sync_write(): : iov_iter_init(&iter, WRITE, &iov, 1, len); 0.00 : ffffffff812cf05b: mov $0x1,%esi 0.00 : ffffffff812cf060: lea -0x68(%rbp),%rdi 0.00 : ffffffff812cf064: mov $0x1,%ecx 0.00 : ffffffff812cf069: lea -0x78(%rbp),%rdx 0.00 : ffffffff812cf06d: callq ffffffff814c45e0 : call_write_iter(): : return file->f_op->write_iter(kio, iter); 0.00 : ffffffff812cf072: mov 0x28(%rbx),%rax 0.00 : ffffffff812cf076: lea -0x68(%rbp),%rsi 0.00 : ffffffff812cf07a: lea -0x40(%rbp),%rdi 0.00 : ffffffff812cf07e: callq *0x28(%rax) : new_sync_write(): : BUG_ON(ret == -EIOCBQUEUED); 0.00 : ffffffff812cf081: cmp $0xfffffffffffffdef,%rax 0.00 : ffffffff812cf087: jne ffffffff812cf033 0.00 : ffffffff812cf089: ud2