当前位置: 首页 > news >正文

网站服务器与虚拟主机销售网页制作

网站服务器与虚拟主机,销售网页制作,网站设计师主要做什么的,绵阳东原建设工程有限公司网站观测数据源 目前按照我的理解#xff0c;和trace相关的常用数据源–探针 大致分为四类。 内核 Trace point kprobe 用户程序 USDT uprobe 在用户程序中#xff0c;USDT是所谓的静态Tracepoint。和内核代码中的Trace point类似。实现方式是在代码开发时#xff0c;使用USDT…观测数据源 目前按照我的理解和trace相关的常用数据源–探针 大致分为四类。 内核 Trace point kprobe 用户程序 USDT uprobe 在用户程序中USDT是所谓的静态Tracepoint。和内核代码中的Trace point类似。实现方式是在代码开发时使用USDT的库和头文件。在代码中埋点。在运行时可以通过一些手段使能这些Tracepoint。而uprobe是在kprobe的基础上沿袭下来。属于是动态探针。实现方式需要依托内核支持。在执行到此指令前或者后进行代码注入。实现trace。 内核支持 引用参考文献 Uprobe-tracer: Uprobe-based Event TracingDocumentation written by Srikar DronamrajuOverview -------- Uprobe based trace events are similar to kprobe based trace events. To enable this feature, build your kernel with CONFIG_UPROBE_EVENTSy.Similar to the kprobe-event tracer, this doesnt need to be activated via current_tracer. Instead of that, add probe points via /sys/kernel/debug/tracing/uprobe_events, and enable it via /sys/kernel/debug/tracing/events/uprobes/EVENT/enabled.However unlike kprobe-event tracer, the uprobe event interface expects the user to calculate the offset of the probepoint in the object.6.6. Dynamic Tracing For kernel analysis, Im using CONFIG_KPROBESy and CONFIG_KPROBE_EVENTSy, to enable kernel dynamic tracing, and CONFIG_FRAME_POINTERy, for frame pointer-based kernel stacks. For user-level analysis, CONFIG_UPROBESy and CONFIG_UPROBE_EVENTSy, for user-level dynamic tracing.Kernel Config: 3.8.6 Here are some kernel CONFIG options for perf_events functionality: # for perf_events: CONFIG_PERF_EVENTSy # for stack traces: CONFIG_FRAME_POINTERy # kernel symbols: CONFIG_KALLSYMSy # tracepoints: CONFIG_TRACEPOINTSy # kernel function trace: CONFIG_FTRACEy # kernel-level dynamic tracing: CONFIG_KPROBESy CONFIG_KPROBE_EVENTSy # user-level dynamic tracing: CONFIG_UPROBESy CONFIG_UPROBE_EVENTSy # full kernel debug info: CONFIG_DEBUG_INFOy # kernel lock tracing: CONFIG_LOCKDEPy # kernel lock tracing: CONFIG_LOCK_STATy # kernel dynamic tracepoint variables: CONFIG_DEBUG_INFOy You may need to build your own kernel to enable these. The exact set you need depends on your needs and kernel version, and list is likely to grow as new features are added to perf_events.测试代码 #include stdio.h #include unistd.hstatic void print_curr_state_one(void) {printf(This is the print current state one function\n); }static void print_curr_state_two(void) {printf(This is the print current state two function\n); }int main() {while(1) {print_curr_state_one();sleep(1);print_curr_state_two();} }通过 perf 使用 uprobe uprobe作为数据源可以通过多种途径使用。不同的工具实现的功能可能有所差别。 # perf probeUsage: perf probe [options] PROBEDEF [PROBEDEF ...]or: perf probe [options] --add PROBEDEF [--add PROBEDEF ...]or: perf probe [options] --del [GROUP:]EVENT ...or: perf probe --list [GROUP:]EVENT ...or: perf probe [options] --funcs-a, --add [EVENT]FUNC[OFF|%return] [[NAME]ARG ...]probe point definition, whereGROUP: Group name (optional)EVENT: Event nameFUNC: Function nameOFF: Offset from function entry (in byte)%return: Put the probe at function returnARG: Probe argument (kprobe-tracer argument format.)-D, --definition [EVENT]FUNC[OFF|%return] [[NAME]ARG ...]Show trace event definition of given traceevent for k/uprobe_events.-d, --del [GROUP:]EVENTdelete a probe event.-f, --force forcibly add events with existing name-F, --funcs [FILTER]Show potential probe-able functions.-k, --vmlinux file vmlinux pathname(not built-in because NO_DWARF1)-L, --line FUNC[:RLN[NUM|-RLN2]]|SRC:ALN[NUM|-ALN2]Show source code lines.(not built-in because NO_DWARF1)-l, --list [GROUP:]EVENTlist up probe events-m, --module modname|pathtarget module name (for online) or path (for offline)-n, --dry-run dry run-q, --quiet be quiet (do not show any messages)-s, --source directorypath to kernel source(not built-in because NO_DWARF1)-V, --vars FUNC[SRC][OFF|%return|:RL|;PT]|SRC:AL|SRC;PTShow accessible variables on PROBEDEF(not built-in because NO_DWARF1)-v, --verbose be more verbose (show parsed arguments, etc)-x, --exec executable|pathtarget executable name or path--cache Manipulate probe cache--demangle Enable symbol demangling--demangle-kernelEnable kernel symbol demangling--externs Show external variables too (with --vars only)(not built-in because NO_DWARF1)--filter [!]FILTERSet a filter (with --vars/funcs only)(default: !__k???tab_* !__crc_* for --vars,!_* for --funcs)--max-probes n Set how many probe points can be found for a probe.--no-inlines Dont search inlined functions(not built-in because NO_DWARF1)--range Show variables location range in scope (with --vars only)(not built-in because NO_DWARF1)--symfs directoryLook for files with symbols relative to this directory--target-ns pidtarget pid for namespace contexts其中这个(not built-in because NO_DWARF1)很有意思这是否意味着不能通过debug info 去获取局部变量也不能通过行号加probe 通过搜索perf的源码发现似乎是编译perf的时候没有开启。 那么我需要自己编译perf 然后移植 查看可用的probe并添加记录 查看可以插入探针的函数 # perf probe -x a.out -F abortplt call_weak_fn completed.8444 data_start deregister_tm_clones frame_dummy main print_curr_state_one print_curr_state_two putsplt register_tm_clones sleepplt通过-x指定执行文件。-F显示可能被用来插入探针的函数。 插入探针 # perf probe -x a.out -a print_curr_state_one Added new event:probe_a:print_curr_state_one (on print_curr_state_one in /home/root/test_uprobe/a.out)You can now use it in all perf tools, such as:perf record -e probe_a:print_curr_state_one -aR sleep 1查看插入的探针 # perf probe -lprobe_a:print_curr_state_one (on print_curr_state_one in /home/root/test_uprobe/a.out)probe_a:print_curr_state_two (on print_curr_state_two in /home/root/test_uprobe/a.out)开启记录新增的探针 # perf record -e probe_a:* -a Couldnt synthesize bpf events. ^C[ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.159 MB perf.data (24 samples) ]查看记录的结果 # perf scripta.out 3198 [000] 15137.303918: probe_a:print_curr_state_two: (40060c)a.out 3198 [000] 15137.304015: probe_a:print_curr_state_one: (4005ec)a.out 3198 [000] 15138.304117: probe_a:print_curr_state_two: (40060c)a.out 3198 [000] 15138.304153: probe_a:print_curr_state_one: (4005ec)a.out 3198 [000] 15139.304244: probe_a:print_curr_state_two: (40060c)a.out 3198 [000] 15139.304278: probe_a:print_curr_state_one: (4005ec)a.out 3198 [000] 15140.304378: probe_a:print_curr_state_two: (40060c)a.out 3198 [000] 15140.304415: probe_a:print_curr_state_one: (4005ec)a.out 3198 [001] 15141.304575: probe_a:print_curr_state_two: (40060c)a.out 3198 [001] 15141.304614: probe_a:print_curr_state_one: (4005ec)a.out 3198 [001] 15142.304696: probe_a:print_curr_state_two: (40060c)a.out 3198 [001] 15142.304729: probe_a:print_curr_state_one: (4005ec)a.out 3198 [001] 15143.304829: probe_a:print_curr_state_two: (40060c)a.out 3198 [001] 15143.304866: probe_a:print_curr_state_one: (4005ec)a.out 3198 [001] 15144.304969: probe_a:print_curr_state_two: (40060c)a.out 3198 [001] 15144.305004: probe_a:print_curr_state_one: (4005ec)a.out 3198 [001] 15145.305104: probe_a:print_curr_state_two: (40060c)a.out 3198 [001] 15145.305137: probe_a:print_curr_state_one: (4005ec)a.out 3198 [000] 15146.305243: probe_a:print_curr_state_two: (40060c)a.out 3198 [000] 15146.305279: probe_a:print_curr_state_one: (4005ec)a.out 3198 [000] 15147.305373: probe_a:print_curr_state_two: (40060c)a.out 3198 [000] 15147.305406: probe_a:print_curr_state_one: (4005ec)a.out 3198 [000] 15148.305499: probe_a:print_curr_state_two: (40060c)a.out 3198 [000] 15148.305533: probe_a:print_curr_state_one: (4005ec)删去不再使用的probe # perf probe -d probe_a:*在LTTng中使用 Create or enable a recording event rule to match Linux kernel events created from a dynamic instrumentation point: lttng [GENERAL OPTIONS] enable-event --kernel(--probeLOC | --functionLOC | --userspace-probeLOC) RECORDNAME[--sessionSESSION] [--channelCHANNEL]# lttng enable-event --kernel --userspace-probe./a.out:print_curr_state_one FUNC_A kernel event FUNC_A created in channel channel0# lttng enable-event --kernel --userspace-probe./a.out:print_curr_state_two FUNC_B kernel event FUNC_B created in channel channel0在设定上uprobe仍然属于是内核提供 所以还是内核的trace事件。 在LTTng中好像没有找到关于uretprobe的内容。也没有发现类似可以按照行或者抓取局部变量的内容。可能是LTTng没有做。 之后正常使能所有内核Trace事件。 然后记录log。进行分析。 之后可以在可视化工具中查看进程调度以及进程运行的细节。 在LTTng的log中没有更多的细节甚至函数名都没有保留只有在注册probe的时候自定义的命名。 可能他们推荐大家使用LTTng-UST的USDT吧。 下一步工作 目前实际上是没有实现更细致的观测。例如perf prob -V /L这种。 可能需要重新编译移植perf.或者寻找其他的数据采集和分析工具。 或者有其他的工具可以使用。我甚至想尝试bpf了。但这意味着重新编译内核打开bpf的支持。 参考文献 Linux K/Uprobe 使用指南 · GitBook (t-head.cn)Linux uprobe: User-Level Dynamic Tracing (brendangregg.com)https://www.kernel.org/doc/Documentation/trace/uprobetracer.txtLinux perf Examples (brendangregg.com)lttng-enable-event(1) [v2.13] — LTTng
http://www.w-s-a.com/news/387264/

相关文章:

  • 天猫网站建设的目标是什么做网站常见问题模板
  • 做php网站需要什么软件天津建设网官方网站
  • 南漳网站开发上海网站推广方法
  • 深圳seo网站大连旅顺房价
  • dede网站 地图什么做有没有做黑市网站
  • 做网站参考文献域名如何做网站
  • 怎么选择网站开发英文网站建设用途
  • 怎样做电子商务网站织梦生成手机网站
  • 公司网站建设选什么服务器网站里怎样添加关键词
  • 深圳建设局网站深业中城绿化项目营销型网站开发流程包括
  • 找销售的网站九江市建设项目服务中心
  • 东原ARC网站建设公司合肥seo网站推广外包
  • 那个网站是做房产中介的网站制作软件小学
  • 做网页怎么建站点视频解析网站
  • 做网站的系统设计网站设计论文前言
  • 做外贸网站多久更新汕头市建设局网站首页
  • 如何建设专业化的网站手机管理网站模板
  • 花生壳做网站如何用腾讯云做网站
  • 搭建集团网站开发app需要哪些软件
  • 网站建设 中企动力福州阀门wordpress 多说评论
  • php网站集成支付宝接口下载免费网络软件
  • 卡盟网站是怎么建设的用花生壳做网站速度可以吗
  • 杭州物联网前十名公司优秀seo平台
  • 网新中英企业网站管理系统wordpress 登录 缓存
  • wordpress模板建站教程wordpress添加广告位手机自适应
  • h5游戏平台入口优化是什么梗
  • 建设银行对公网站打不开网络推广活动方案主题和思路
  • 茶叶网站开发目的和意义网页设计需要考什么证
  • 高端企业网站建设公司怎么做实用性建设网站都需要哪些
  • 网站备案必须要幕布吗易企秀网站怎么做轮播图