title: kprobe of tcp_retransmit_skb. instead of tcp_retransmit_skb @tcp_states, I want to kprobe __napi_schedule
body: <p>In the book BPF Performance Tools there is a implementation of kprobe of tcp_retransmit_skb. I want to do the same thing but instead of tcp_retransmit_skb @tcp_states, I want to kprobe _<em>napi_schedule and incompocate the enum NAPI_STATE</em>* of 'include/linux/netdevice.h'. There is my implementation of the above:</p>
  <pre><code> 1 #!/usr/local/bin/bpftrace
    2
    3 #include &lt;linux/netdevice.h&gt;
    4
    5 kprobe:__napi_schedule
    6 {
    7         $ns = (struct napi_struct *)arg0;
    8
    9         // Poll is scheduled
   10         @napi[1] = &quot;NAPI_STATE_SCHED&quot;;
   11         @napi[2] = &quot;NAPI_STATE_DISABLE&quot;;
   12         @napi[3] = &quot;NAPI_STATE_NPSVC&quot;;
   13         @napi[4] = &quot;NAPI_STATE_HASHED&quot;;
   14         @napi[5] = &quot;NAPI_STATE_NO_BUSY_POLL&quot;;
   15
   16
   17         printf(&quot;-------------------\n&quot;);
   18         printf(&quot;\n&quot;);
   19         printf(&quot;__napi_schedule: %s pid: %d\n&quot;, comm, pid);
   20         printf(&quot;\n&quot;);
   21         $state = $ns-&gt;state;
   22         printf(&quot;$ns-&gt;state: %d\n&quot;, $state);
   23         $statestr = @napi[$state];
   24         printf(&quot;state is: %s\n&quot;, $statestr);
   25         clear(@napi);
   26         printf(&quot;--------------------\n&quot;);
   27 }
  </code></pre>
  <p>When I tried to run it, it shows nothing in my printf of the 'state is'.</p>
  <p>The output is:</p>
  <pre><code>...
  __napi_schedule: tmux: server pid: 9003
  
  $ns-&gt;state: 17
  state is:
  --------------------
  -------------------
  
  __napi_schedule: tmux: server pid: 9003
  
  $ns-&gt;state: 17
  state is:
  --------------------
  -------------------
  
  __napi_schedule: tmux: server pid: 9003
  
  $ns-&gt;state: 17
  state is:
  --------------------
  ...
  </code></pre>