File: struct_let.bt

package info (click to toggle)
bpftrace 0.24.1-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 10,496 kB
  • sloc: cpp: 60,982; ansic: 10,952; python: 953; yacc: 665; sh: 536; lex: 295; makefile: 22
file content (29 lines) | stat: -rwxr-xr-x 408 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
struct T {
  uint32_t a;
  uint32_t b[2];
};

struct W {
  uint32_t a;
  struct T t;
};

struct C {
  uint32_t a;
  void * b;
  struct W w[10];
};

uprobe:./testprogs/struct_array:clear {
  let $c: struct C *;
  let $w: struct W[10];

  $c = (struct C *) arg0;
  $w = $c->w;

  printf("%d ", $w[0].a);
  printf("%d ", $w[2].a);
  printf("%d ", $w[4].a);
  printf("%d ", $w[6].a);
  printf("%d ", $w[8].a);
}