#ifndef __TARGET_USB_GADGET_H__ #define __TARGET_USB_GADGET_H__ #include /* #include */ #include #include #include #include #include #define USBG_NAMELEN 32 #define fuas_to_gadget(f) (f->function.config->cdev->gadget) #define UASP_SS_EP_COMP_LOG_STREAMS 4 #define UASP_SS_EP_COMP_NUM_STREAMS (1 << UASP_SS_EP_COMP_LOG_STREAMS) enum { USB_G_STR_INT_UAS = 0, USB_G_STR_INT_BBB, }; #define USB_G_ALT_INT_BBB 0 #define USB_G_ALT_INT_UAS 1 #define USB_G_DEFAULT_SESSION_TAGS 128 struct tcm_usbg_nexus { struct se_session *tvn_se_sess; }; struct usbg_tpg { struct mutex tpg_mutex; /* SAS port target portal group tag for TCM */ u16 tport_tpgt; /* Pointer back to usbg_tport */ struct usbg_tport *tport; struct workqueue_struct *workqueue; /* Returned by usbg_make_tpg() */ struct se_portal_group se_tpg; u32 gadget_connect; struct tcm_usbg_nexus *tpg_nexus; atomic_t tpg_port_count; struct usb_function_instance *fi; }; struct usbg_tport { /* Binary World Wide unique Port Name for SAS Target port */ u64 tport_wwpn; /* ASCII formatted WWPN for SAS Target port */ char tport_name[USBG_NAMELEN]; /* Returned by usbg_make_tport() */ struct se_wwn tport_wwn; }; enum uas_state { UASP_SEND_DATA, UASP_RECEIVE_DATA, UASP_SEND_STATUS, UASP_QUEUE_COMMAND, }; #define USBG_MAX_CMD 64 struct usbg_cmd { /* common */ u8 cmd_buf[USBG_MAX_CMD]; u32 data_len; struct work_struct work; int unpacked_lun; struct se_cmd se_cmd; void *data_buf; /* used if no sg support available */ struct f_uas *fu; struct completion write_complete; struct kref ref; /* UAS only */ u16 tag; u16 prio_attr; struct sense_iu sense_iu; enum uas_state state; struct uas_stream *stream; /* BOT only */ __le32 bot_tag; unsigned int csw_code; unsigned is_read:1; }; struct uas_stream { struct usb_request *req_in; struct usb_request *req_out; struct usb_request *req_status; }; struct usbg_cdb { struct usb_request *req; void *buf; }; struct bot_status { struct usb_request *req; struct bulk_cs_wrap csw; }; struct f_uas { struct usbg_tpg *tpg; struct usb_function function; u16 iface; u32 flags; #define USBG_ENABLED (1 << 0) #define USBG_IS_UAS (1 << 1) #define USBG_USE_STREAMS (1 << 2) #define USBG_IS_BOT (1 << 3) #define USBG_BOT_CMD_PEND (1 << 4) struct usbg_cdb cmd; struct usb_ep *ep_in; struct usb_ep *ep_out; /* UAS */ struct usb_ep *ep_status; struct usb_ep *ep_cmd; struct uas_stream stream[UASP_SS_EP_COMP_NUM_STREAMS]; /* BOT */ struct bot_status bot_status; struct usb_request *bot_req_in; struct usb_request *bot_req_out; }; #endif /* __TARGET_USB_GADGET_H__ */ t/kernel/trace/Makefile
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-05-24 11:39:34 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-24 11:39:34 -0700
commit654443e20dfc0617231f28a07c96a979ee1a0239 (patch)
treea0dc3f093eb13892539082e663607c34b4fc2d07 /kernel/trace/Makefile
parent2c01e7bc46f10e9190818437e564f7e0db875ae9 (diff)
parent9cba26e66d09bf394ae5a739627a1dc8b7cae6f4 (diff)
Merge branch 'perf-uprobes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull user-space probe instrumentation from Ingo Molnar: "The uprobes code originates from SystemTap and has been used for years in Fedora and RHEL kernels. This version is much rewritten, reviews from PeterZ, Oleg and myself shaped the end result. This tree includes uprobes support in 'perf probe' - but SystemTap (and other tools) can take advantage of user probe points as well. Sample usage of uprobes via perf, for example to profile malloc() calls without modifying user-space binaries. First boot a new kernel with CONFIG_UPROBE_EVENT=y enabled. If you don't know which function you want to probe you can pick one from 'perf top' or can get a list all functions that can be probed within libc (binaries can be specified as well): $ perf probe -F -x /lib/libc.so.6 To probe libc's malloc(): $ perf probe -x /lib64/libc.so.6 malloc Added new event: probe_libc:malloc (on 0x7eac0) You can now use it in all perf tools, such as: perf record -e probe_libc:malloc -aR sleep 1 Make use of it to create a call graph (as the flat profile is going to look very boring): $ perf record -e probe_libc:malloc -gR make [ perf record: Woken up 173 times to write data ] [ perf record: Captured and wrote 44.190 MB perf.data (~1930712 $ perf report | less 32.03% git libc-2.15.so [.] malloc | --- malloc 29.49% cc1 libc-2.15.so [.] malloc | --- malloc | |--0.95%-- 0x208eb1000000000 | |--0.63%-- htab_traverse_noresize 11.04% as libc-2.15.so [.] malloc | --- malloc | 7.15% ld libc-2.15.so [.] malloc | --- malloc | 5.07% sh libc-2.15.so [.] malloc | --- malloc | 4.99% python-config libc-2.15.so [.] malloc | --- malloc | 4.54% make libc-2.15.so [.] malloc | --- malloc | |--7.34%-- glob | | | |--93.18%-- 0x41588f | | | --6.82%-- glob | 0x41588f ... Or: $ perf report -g flat | less # Overhead Command Shared Object Symbol # ........ ............. ............. .......... # 32.03% git libc-2.15.so [.] malloc 27.19% malloc 29.49% cc1 libc-2.15.so [.] malloc 24.77% malloc 11.04% as libc-2.15.so [.] malloc 11.02% malloc 7.15% ld libc-2.15.so [.] malloc 6.57% malloc ... The core uprobes design is fairly straightforward: uprobes probe points register themselves at (inode:offset) addresses of libraries/binaries, after which all existing (or new) vmas that map that address will have a software breakpoint injected at that address. vmas are COW-ed to preserve original content. The probe points are kept in an rbtree. If user-space executes the probed inode:offset instruction address then an event is generated which can be recovered from the regular perf event channels and mmap-ed ring-buffer. Multiple probes at the same address are supported, they create a dynamic callback list of event consumers. The basic model is further complicated by the XOL speedup: the original instruction that is probed is copied (in an architecture specific fashion) and executed out of line when the probe triggers. The XOL area is a single vma per process, with a fixed number of entries (which limits probe execution parallelism). The API: uprobes are installed/removed via /sys/kernel/debug/tracing/uprobe_events, the API is integrated to align with the kprobes interface as much as possible, but is separate to it. Injecting a probe point is privileged operation, which can be relaxed by setting perf_paranoid to -1. You can use multiple probes as well and mix them with kprobes and regular PMU events or tracepoints, when instrumenting a task." Fix up trivial conflicts in mm/memory.c due to previous cleanup of unmap_single_vma(). * 'perf-uprobes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (21 commits) perf probe: Detect probe target when m/x options are absent perf probe: Provide perf interface for uprobes tracing: Fix kconfig warning due to a typo tracing: Provide trace events interface for uprobes tracing: Extract out common code for kprobes/uprobes trace events tracing: Modify is_delete, is_return from int to bool uprobes/core: Decrement uprobe count before the pages are unmapped uprobes/core: Make background page replacement logic account for rss_stat counters uprobes/core: Optimize probe hits with the help of a counter uprobes/core: Allocate XOL slots for uprobes use uprobes/core: Handle breakpoint and singlestep exceptions uprobes/core: Rename bkpt to swbp uprobes/core: Make order of function parameters consistent across functions uprobes/core: Make macro names consistent uprobes: Update copyright notices uprobes/core: Move insn to arch specific structure uprobes/core: Remove uprobe_opcode_sz uprobes/core: Make instruction tables volatile uprobes: Move to kernel/events/ uprobes/core: Clean up, refactor and improve the code ...
Diffstat (limited to 'kernel/trace/Makefile')