notrace void probe_udpv4_rcv(void *_data, struct sk_buff *skb) { struct marker *marker; marker = &GET_MARKER(net, udpv4_rcv); ltt_specialized_trace(marker, marker->single.probe_private, &skb, sizeof(skb), sizeof(skb)); }
notrace void probe_memory_handle_fault_exit(int res) { struct marker *marker; marker = &GET_MARKER(mm_handle_fault_exit); ltt_specialized_trace(marker->single.probe_private, &res, sizeof(res), sizeof(res)); }
notrace void probe_syscall_exit(long ret) { struct marker *marker; marker = &GET_MARKER(kernel_syscall_exit); ltt_specialized_trace(marker->single.probe_private, &ret, sizeof(ret), sizeof(ret)); }
notrace void probe_kernel_page_fault_nosem_exit(void *_data, int res) { struct marker *marker; marker = &GET_MARKER(kernel, page_fault_nosem_exit); ltt_specialized_trace(marker, marker->single.probe_private, NULL, 0, 0); }
notrace void probe_trap_exit(void) { struct marker *marker; marker = &GET_MARKER(kernel, trap_exit); ltt_specialized_trace(marker, marker->single.probe_private, NULL, 0, 0); }
notrace void probe_kernel_page_fault_get_user_exit(void *_data, int res) { struct marker *marker; marker = &GET_MARKER(kernel, page_fault_get_user_exit); ltt_specialized_trace(marker, marker->single.probe_private, &res, sizeof(res), sizeof(res)); }
notrace void probe_irq_exit(void *_data, irqreturn_t retval) { struct marker *marker; unsigned char data; data = IRQ_RETVAL(retval); marker = &GET_MARKER(kernel, irq_exit); ltt_specialized_trace(marker, marker->single.probe_private, &data, sizeof(data), sizeof(data)); }
notrace void probe_net_napi_complete(void *_data, struct napi_struct *n) { struct marker *marker; unsigned long data; data = (unsigned long)n; marker = &GET_MARKER(net, napi_complete); ltt_specialized_trace(marker, marker->single.probe_private, &data, sizeof(data), sizeof(data)); }
notrace void probe_softirq_raise(void *_data, unsigned int nr) { struct marker *marker; unsigned char data; data = nr; marker = &GET_MARKER(kernel, softirq_raise); ltt_specialized_trace(marker, marker->single.probe_private, &data, sizeof(data), sizeof(data)); }
notrace void probe_syscall_entry(struct pt_regs *regs, long id) { struct marker *marker; struct serialize_long_int data; data.f1 = instruction_pointer(regs); data.f2 = (int)id; marker = &GET_MARKER(kernel_syscall_entry); ltt_specialized_trace(marker->single.probe_private, &data, serialize_sizeof(data), sizeof(long)); }
notrace void probe_net_dev_receive(void *_data, struct sk_buff *skb) { struct marker *marker; struct serialize_long_short data; data.f1 = (unsigned long)skb; data.f2 = skb->protocol; marker = &GET_MARKER(net, dev_receive); ltt_specialized_trace(marker, marker->single.probe_private, &data, serialize_sizeof(data), sizeof(long)); }
notrace void probe_softirq_exit(void *_data, struct softirq_action *h, struct softirq_action *softirq_vec) { struct marker *marker; unsigned char data; data = ((unsigned long)h - (unsigned long)softirq_vec) / sizeof(*h); marker = &GET_MARKER(kernel, softirq_exit); ltt_specialized_trace(marker, marker->single.probe_private, &data, sizeof(data), sizeof(data)); }
notrace void probe_page_free(void *_data, struct page *page, unsigned int order) { struct marker *marker; struct serialize_long_int data; data.f1 = page_to_pfn(page); data.f2 = order; marker = &GET_MARKER(mm, page_free); ltt_specialized_trace(marker, marker->single.probe_private, &data, serialize_sizeof(data), sizeof(long)); }
notrace void probe_irq_next_handler(void *_data, unsigned int id, struct irqaction *action, irqreturn_t prev_ret) { struct marker *marker; struct serialize_long_char data; data.f1 = (unsigned long) (action ? action->handler : NULL); data.f2 = prev_ret; marker = &GET_MARKER(kernel, irq_next_handler); ltt_specialized_trace(marker, marker->single.probe_private, &data, serialize_sizeof(data), sizeof(long)); }
notrace void probe_kernel_page_fault_get_user_entry(void *_data, struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, int write_access) { struct marker *marker; struct serialize_long_char data; data.f1 = address; data.f2 = (unsigned char)!!write_access; marker = &GET_MARKER(kernel, page_fault_get_user_entry); ltt_specialized_trace(marker, marker->single.probe_private, &data, serialize_sizeof(data), sizeof(long)); }
notrace void probe_timer_set(void *_data, struct timer_list *timer) { struct marker *marker; struct serialize_long_long_long data; data.f1 = timer->expires; data.f2 = (unsigned long)timer->function; data.f3 = timer->data; marker = &GET_MARKER(kernel, timer_set); ltt_specialized_trace(marker, marker->single.probe_private, &data, serialize_sizeof(data), sizeof(long)); }
notrace void probe_sched_wakeup(void *_data, struct task_struct *p, int success) { struct marker *marker; struct serialize_int_int_short data; data.f1 = p->pid; data.f2 = task_cpu(p); data.f3 = p->state; marker = &GET_MARKER(kernel, sched_try_wakeup); ltt_specialized_trace(marker, marker->single.probe_private, &data, serialize_sizeof(data), sizeof(int)); }
notrace void probe_memory_handle_fault_entry(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, int write_access) { struct marker *marker; struct serialize_long_long_int data; data.f1 = address; data.f2 = KSTK_EIP(current); data.f3 = write_access; marker = &GET_MARKER(mm_handle_fault_entry); ltt_specialized_trace(marker->single.probe_private, &data, serialize_sizeof(data), sizeof(long)); }
notrace void probe_sched_switch(void *_data, struct task_struct *prev, struct task_struct *next) { struct marker *marker; struct serialize_int_int_short data; data.f1 = prev->pid; data.f2 = next->pid; data.f3 = prev->state; marker = &GET_MARKER(kernel, sched_schedule); ltt_specialized_trace(marker, marker->single.probe_private, &data, serialize_sizeof(data), sizeof(int)); }
notrace void probe_socket_sendmsg(void *_data, struct socket *sock, struct msghdr *msg, size_t size, int ret) { struct marker *marker; struct serialize_long_long_sizet_int data; data.f1 = (unsigned long)sock; data.f2 = (unsigned long)msg; data.f3 = size; data.f4 = ret; marker = &GET_MARKER(net, socket_sendmsg); ltt_specialized_trace(marker, marker->single.probe_private, &data, serialize_sizeof(data), sizeof(size_t)); }
notrace void probe_trap_entry(struct pt_regs *regs, long id) { struct marker *marker; struct serialize_long_short data; if (likely(regs)) data.f1 = instruction_pointer(regs); else data.f1 = 0UL; data.f2 = (unsigned short)id; marker = &GET_MARKER(kernel, trap_entry); ltt_specialized_trace(marker, marker->single.probe_private, &data, serialize_sizeof(data), sizeof(long)); }
notrace void probe_page_alloc(struct page *page, unsigned int order) { struct marker *marker; struct serialize_long_int data; if (unlikely(!page)) return; data.f1 = page_to_pfn(page); data.f2 = order; marker = &GET_MARKER(mm, page_alloc); ltt_specialized_trace(marker, marker->single.probe_private, &data, serialize_sizeof(data), sizeof(long)); }
notrace void probe_net_napi_complete(void *_data, struct napi_struct *n) { struct marker *marker; struct serialize_long_ifname data; size_t data_len = 0; data.f1 = (unsigned long)n; data_len += sizeof(data.f1); /* No need to align for strings */ strcpy(data.f2, n->dev ? n->dev->name : "<unk>"); data_len += strlen(data.f2) + 1; marker = &GET_MARKER(net, napi_complete); ltt_specialized_trace(marker, marker->single.probe_private, &data, data_len, sizeof(long)); }
notrace void probe_kernel_page_fault_nosem_entry(void *_data, struct pt_regs *regs, int trapnr, unsigned long address) { struct marker *marker; struct serialize_long_long_short data; if (likely(regs)) data.f1 = instruction_pointer(regs); else data.f1 = 0UL; data.f2 = address; data.f3 = (unsigned short)trapnr; marker = &GET_MARKER(kernel, page_fault_nosem_entry); ltt_specialized_trace(marker, marker->single.probe_private, &data, serialize_sizeof(data), sizeof(long)); }
notrace void probe_kernel_page_fault_entry(struct pt_regs *regs, int trapnr, struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, int write_access) { struct marker *marker; struct serialize_long_long_short_char data; if (likely(regs)) data.f1 = instruction_pointer(regs); else data.f1 = 0UL; data.f2 = address; data.f3 = (unsigned short)trapnr; data.f4 = (unsigned char)!!write_access; marker = &GET_MARKER(kernel, page_fault_entry); ltt_specialized_trace(marker, marker->single.probe_private, &data, serialize_sizeof(data), sizeof(long)); }
notrace void probe_irq_entry(void *_data, unsigned int id, struct pt_regs *regs, struct irqaction *action) { struct marker *marker; struct serialize_long_long_short_char data; if (unlikely(!regs)) regs = get_irq_regs(); if (likely(regs)) { data.f1 = instruction_pointer(regs); data.f4 = !user_mode(regs); } else { data.f1 = 0UL; data.f4 = 1; } data.f2 = (unsigned long) (action ? action->handler : NULL); data.f3 = id; marker = &GET_MARKER(kernel, irq_entry); ltt_specialized_trace(marker, marker->single.probe_private, &data, serialize_sizeof(data), sizeof(long)); }
/** * write_event - write a userspace string into the trace system * @file: file pointer * @user_buf: user string * @count: length to copy, including the final NULL * @ppos: unused * * Copy a string into a trace event, in channel "userspace", event "event". * Copies until either \n or \0 is reached. * On success, returns the number of bytes copied from the source, including the * \n or \0 character (if there was one in the count range). It cannot return * more than count. * Inspired from tracing_mark_write implementation from Steven Rostedt and * Ingo Molnar. */ static ssize_t write_event(struct file *file, const char __user *user_buf, size_t count, loff_t *ppos) { struct marker *marker; char *buf, *end; long copycount; ssize_t ret; buf = kmalloc(count + 1, GFP_KERNEL); if (!buf) { ret = -ENOMEM; goto string_out; } copycount = strncpy_from_user(buf, user_buf, count); if (copycount < 0) { ret = -EFAULT; goto string_err; } /* Cut from the first nil or newline. */ buf[copycount] = '\0'; end = strchr(buf, '\n'); if (end) { *end = '\0'; copycount = end - buf; } /* Add final \0 to copycount */ copycount++; marker = &GET_MARKER(userspace, event); ltt_specialized_trace(marker, marker->single.probe_private, buf, copycount, sizeof(char)); /* If there is no \0 nor \n in count, do not return a larger value */ ret = min_t(size_t, copycount, count); string_err: kfree(buf); string_out: return ret; }