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

09 用户态跟踪:如何使用eBPF排查应用程序?

09  用户态跟踪:如何使用eBPF排查应用程序?

sudo bpftrace -e 'usdt:/usr/bin/python3:function__entry { printf("%s:%d %s\n", str(arg0), arg2, str(arg1))}'

# -*- coding: UTF-8 -*-

import socket
from socket import SOL_SOCKET, SO_REUSEADDR
import subprocess
import struct
import json

PORT = 18284

#简单TCP通信
def main():
    tcpSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    print(tcpSocket)
    tcpSocket.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
    tcpSocket.bind(('127.0.0.1', PORT))
    tcpSocket.listen(5)
    print('start....')
    while True:
        conn, client_addr = tcpSocket.accept()
        print('new client connected ', conn, client_addr)
        while True:
            try:
                print('recv data ...')
                data = conn.recv(1024)
                if len(data) == 0:
                    break
                print('recv data is ', data)
                conn.send(data.upper())
            except ConnectionResetError:
                break

    conn.close()
    phone.close()
main()

/usr/lib/python3.9/socket.py:220 __init__
/usr/lib/python3.9/socket.py:243 __repr__
/usr/lib/python3.9/socket.py:513 family
/usr/lib/python3.9/socket.py:99 _intenum_converter
/usr/lib/python3.9/enum.py:358 __call__
/usr/lib/python3.9/enum.py:670 __new__
/usr/lib/python3.9/socket.py:519 type
/usr/lib/python3.9/socket.py:99 _intenum_converter
/usr/lib/python3.9/enum.py:358 __call__
/usr/lib/python3.9/enum.py:670 __new__
/usr/lib/python3.9/enum.py:740 __str__
/usr/lib/python3.9/enum.py:740 __str__
/usr/lib/python3.9/socket.py:286 accept


/usr/lib/python3.9/socket.py:513 family
/usr/lib/python3.9/socket.py:99 _intenum_converter
/usr/lib/python3.9/enum.py:358 __call__
/usr/lib/python3.9/enum.py:670 __new__
/usr/lib/python3.9/socket.py:519 type
/usr/lib/python3.9/socket.py:99 _intenum_converter
/usr/lib/python3.9/enum.py:358 __call__
/usr/lib/python3.9/enum.py:670 __new__
/usr/lib/python3.9/socket.py:220 __init__
/usr/lib/python3.9/socket.py:243 __repr__
/usr/lib/python3.9/socket.py:513 family
/usr/lib/python3.9/socket.py:99 _intenum_converter
/usr/lib/python3.9/enum.py:358 __call__
/usr/lib/python3.9/enum.py:670 __new__
/usr/lib/python3.9/socket.py:519 type
/usr/lib/python3.9/socket.py:99 _intenum_converter
/usr/lib/python3.9/enum.py:358 __call__
/usr/lib/python3.9/enum.py:670 __new__
/usr/lib/python3.9/enum.py:740 __str__
/usr/lib/python3.9/enum.py:740 __str__


http://www.kler.cn/a/109053.html

相关文章:

  • STM32学习笔记------GPIO介绍
  • wordpress搭建主题可配置json
  • Day 63 || 拓扑排序、dijkstra
  • 力扣 LeetCode 27. 移除元素(Day1:数组)
  • 微服务电商平台课程三:搭建后台服务
  • SQL HAVING子句
  • python自动化测试(七):鼠标事件
  • Swift如何优雅漂亮的打印字典、json
  • RabbitMQ学习04
  • conda: error: argument COMMAND: invalid choice: ‘activate‘
  • 阿里云2023年双11活动时间、活动入口、活动内容详细解读
  • 程序化交易(二)level2行情数据源接入
  • LeetCode题:88合并两个有序数组,283移动零,448找到所有数组中消失的数字
  • idea 没加载 provided的包
  • GoLong的学习之路(十二)语法之标准库 flag的使用
  • LeetCode 125 验证回文串 简单
  • stream流—关于Collectors.toMap使用详解
  • Ubuntu服务器中java -jar 后台运行Spring Boot项目
  • 精通Nginx(01)-产品概览
  • 物联网数据采集网关连接设备与云平台的关键桥梁
  • calloc、malloc、realloc函数的区别及用法
  • 【力扣SQL】几个常见SQL题
  • 并发编程
  • uniapp开发小程序—根据生日日期计算年龄 周岁
  • 【自动驾驶】Free space与Ray casting
  • SpringBoot面试题8:运行 Spring Boot 有哪几种方式?Spring Boot 需要独立的容器运行吗?