public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug runtime/28107] New: error: ‘struct task_struct’ has no member named ‘state’
@ 2021-07-20  5:15 cxxtao at gmail dot com
  2021-07-20 16:03 ` [Bug runtime/28107] " wcohen at redhat dot com
  0 siblings, 1 reply; 2+ messages in thread
From: cxxtao at gmail dot com @ 2021-07-20  5:15 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=28107

            Bug ID: 28107
           Summary: error: ‘struct task_struct’ has no member named
                    ‘state’
           Product: systemtap
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: runtime
          Assignee: systemtap at sourceware dot org
          Reporter: cxxtao at gmail dot com
  Target Milestone: ---

My simple stp script:
=======================

#!/usr/bin/stap -v

probe begin {
 printf("start watching, press Ctrl+C to get the result...\n");
}

global hit_cnt
global cwnd_stat
function watch(sock:long, sockb:long, tport:long) {
  tcphdr = __get_skb_tcphdr(sockb);
  if (__tcp_skb_sport(tcphdr) == tport
      || __tcp_skb_dport(tcphdr) == tport) {
    hit_cnt += 1;
        cwnd_stat <<< tcp_get_info_snd_cwnd(sock);
  }
}

probe kernel.function("tcp_ack").return {
  watch(@entry($sk), @entry($skb), $1);
}

probe end {
  printf("\nhandled %d ack in total\n", hit_cnt);
  if (@count(cwnd_stat) > 0)
    #print(@hist_log(cwnd_stat))
    print(@hist_linear(cwnd_stat, 0, 5000, 200));
}



The error reported:
======================

Pass 1: parsed user script and 489 library scripts using
214732virt/84812res/5812shr/79192data kb, in 500usr/30sys/526real ms.
Pass 2: analyzed script: 7 probes, 12 functions, 3 embeds, 9 globals using
282900virt/153836res/6956shr/147360data kb, in 3060usr/1810sys/8929real ms.
Pass 3: translated to C into
"/tmp/stapQ7coV3/stap_e0bd1702d3065442071dbf4e6a9c2b95_21745_src.c" using
282900virt/154028res/7148shr/147360data kb, in 10usr/10sys/19real ms.
In file included from /usr/share/systemtap/runtime/linux/task_finder2.c:4,
                 from /usr/share/systemtap/runtime/linux/task_finder.c:17,
                 from /usr/share/systemtap/runtime/linux/runtime.h:256,
                 from /usr/share/systemtap/runtime/runtime.h:26,
                 from
/tmp/stapQ7coV3/stap_e0bd1702d3065442071dbf4e6a9c2b95_21745_src.c:21:
/usr/share/systemtap/runtime/stp_utrace.c: In function ‘utrace_do_stop’:
/usr/share/systemtap/runtime/stp_utrace.c:38:14: error: ‘struct task_struct’
has no member named ‘state’; did you mean ‘__state’?
   38 |  do { (tsk)->state = (state_value); } while (0)
      |              ^~~~~
/usr/share/systemtap/runtime/stp_utrace.c:1246:4: note: in expansion of macro
‘__stp_set_task_state’
 1246 |    __stp_set_task_state(target, TASK_TRACED);
      |    ^~~~~~~~~~~~~~~~~~~~
/usr/share/systemtap/runtime/stp_utrace.c: In function ‘utrace_wakeup’:
/usr/share/systemtap/runtime/stp_utrace.c:1266:11: error: ‘struct task_struct’
has no member named ‘state’; did you mean ‘__state’?
 1266 |   target->state = TASK_STOPPED;
      |           ^~~~~
      |           __state
make[2]: ***
[/tmp/stapQ7coV3/stap_e0bd1702d3065442071dbf4e6a9c2b95_21745_src.o] Error 1
make[1]: *** [/tmp/stapQ7coV3] Error 2
make: *** [__sub-make] Error 2
WARNING: kbuild exited with status: 2
Pass 4: compiled C into "stap_e0bd1702d3065442071dbf4e6a9c2b95_21745.ko" in
26850usr/3470sys/6437real ms.
Pass 4: compilation failed.  [man error::pass4]

My fixs:
===================

According to the error message, I renamed the member to '__state' in
stp_utrace.c, then the script runs fine.

Version Info:
===================

systemtap git commitid: a29f65d @ git://sourceware.org/git/systemtap.git
the kernel git commitid: 9615fe3 @
git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug runtime/28107] error: ‘struct task_struct’ has no member named ‘state’
  2021-07-20  5:15 [Bug runtime/28107] New: error: ‘struct task_struct’ has no member named ‘state’ cxxtao at gmail dot com
@ 2021-07-20 16:03 ` wcohen at redhat dot com
  0 siblings, 0 replies; 2+ messages in thread
From: wcohen at redhat dot com @ 2021-07-20 16:03 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=28107

William Cohen <wcohen at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |wcohen at redhat dot com
         Resolution|---                         |DUPLICATE

--- Comment #1 from William Cohen <wcohen at redhat dot com> ---
This looks to be a duplicate of PR28079.  The upstream systemtap git repo has
commit a29f65d5750f6379afeca99c5d641598ff638517 that should address that.

*** This bug has been marked as a duplicate of bug 28079 ***

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-20 16:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-20  5:15 [Bug runtime/28107] New: error: ‘struct task_struct’ has no member named ‘state’ cxxtao at gmail dot com
2021-07-20 16:03 ` [Bug runtime/28107] " wcohen at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).