Skip to content

Go struct documentation on the httptraceKprobe tool  #46

@joelcisnerosss

Description

@joelcisnerosss

Hi All,

I am trying to build a similar tool and ran into a block while reading the following code as I couldn't find go documentation specifying the struct format.

// This needs to match exactly with the Go version of the struct.
struct syscall_write_event_t {
  // We split attributes into a separate struct, because BPF gets upset if you do lots of
  // size arithmetic. This makes it so that it's attributes followed by message.
  struct attr_t {
    int event_type;
    int fd;
    int bytes;
    // Care needs to be taken as only msg_size bytes of msg are guaranteed
    // to be valid.
    int msg_size;
  } attr;
  char msg[MAX_MSG_SIZE];
}; ```

Could I possibly have a link to the go documentation where it specifies that this struct syscall_write_event_t
 is as given. Also, if the program would be compiled in the future with python or another language, 
would I have to then use the documentation of given language for this struct. If anyone has the 
link of relevant documentation for python or C, please let me know! 

Thanks 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions