Re: struct assignment?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> I found there seems no declaring about "struct ftrace_entry".
>
> usually we use a struct we will declare its elements such as:
>
> struct usb_host_endpoint {
> Â Â Â Âstruct usb_endpoint_descriptor Âdesc;
>    Âstruct list_head        Âurb_list;
>    Âvoid              Â*hcpriv;
> ......................
> };
>

There is not an "explicit" declaration but if you look at
kernel/trace/trace.h you will find this macro:

#define FTRACE_ENTRY(name, struct_name, id, tstruct, print)     \
        struct struct_name {                                    \
                struct trace_entry      ent;                    \
                tstruct                                         \
        }

> I guess the secret should be "if_assign", but how does compiler interpret it?
>
> --

Actually in kernel/trace/trace_entries.h the macro is used to declare
the ftrace_entry

FTRACE_ENTRY(function, ftrace_entry,

        TRACE_FN,

        F_STRUCT(
                __field(        unsigned long,  ip              )
                __field(        unsigned long,  parent_ip       )
        ),

        F_printk(" %lx <-- %lx", __entry->ip, __entry->parent_ip)
);

Also in this header other structures are declared in the same way for
example ftrace_graph_ent_entry and and ftrace_graph_ret_entry. If you
search for "struct ftrace_graph_ret_entry" declaration you won't find
anything either.

Best regards,

-- 
-----------------------------------------
Javier MartÃnez Canillas
(+34) 682 39 81 69
PhD Student in High Performance Computing
Computer Architecture and Operating System Department (CAOS)
Universitat AutÃnoma de Barcelona
Barcelona, Spain

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux