• trace_net_dev_xmit 定义在何处?



    net/core/dev.c中有:

    rc = ops->ndo_start_xmit(skb, dev);
    trace_net_dev_xmit(skb, rc);

    在 include/trace/events/net.h中有
    TRACE_EVENT(net_dev_xmit,。。。


    在 include/linux/tracepoint.h中有
    #define TRACE_EVENT(name, proto, args, struct, assign, print)    \
        DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
        
    #define DECLARE_TRACE(name, proto, args)                \
            __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), 1,    \
                    PARAMS(void *__data, proto),        \
                    PARAMS(__data, args))
                        
    #define __DECLARE_TRACE(name, proto, args, cond, data_proto, data_args)    \
        static inline void trace_##name(proto)                \
        { }                                \
        static inline int                        \
        register_trace_##name(void (*probe)(data_proto),        \
                      void *data)                \
        {                                \
            return -ENOSYS;                        \
        }                                \
        static inline int                        \
        unregister_trace_##name(void (*probe)(data_proto),        \
                    void *data)                \
        {                                \
            return -ENOSYS;                        \
        }                                \
        static inline void check_trace_callback_type_##name(void (*cb)(data_proto)) \
        {                                \
        }

    好家伙,trace_##name 终于现身了。


  • 相关阅读:
    Python挂载杂记
    Python Log的使用, 模块化
    Python实现图片长宽比例缩放和填充
    系统监控与硬盘
    linux基础三
    linux基础二
    linux基础一
    网络基础
    操作系统
    计算机硬件基础
  • 原文地址:https://www.cnblogs.com/mull/p/4477851.html
Copyright © 2020-2023  润新知