Bug 123068 - sysutils/bubblemon2 bubblemon-dockapp: error extracting symbols
Summary: sysutils/bubblemon2 bubblemon-dockapp: error extracting symbols
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-25 09:50 UTC by regisr
Modified: 2011-02-13 04:23 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description regisr 2008-04-25 09:50:01 UTC
(See PR ports/123047)
Same problem for sysutils/bubblemon2 bubblemon-dockapp
They exit with message "error extracting symbols"

bubblemon-dockapp-1.46_4
bubblemon2-2.0.9
wmcpuload-1.0.1_3
Comment 1 Pietro Cerutti freebsd_committer freebsd_triage 2008-06-21 01:13:50 UTC
Responsible Changed
From-To: freebsd-ports-bugs->gahr

I'll take it.
Comment 2 Pietro Cerutti freebsd_committer freebsd_triage 2008-06-23 23:58:01 UTC
State Changed
From-To: open->feedback

Hi, the following patch fixes bubblemon-dockapp. The one for bubblemon2 
is yet to come... 

Can you approve please? 

Index: Makefile 
=================================================================== RCS 
file: /home/pcvs/ports/sysutils/bubblemon-dockapp/Makefile,v retrieving 
revision 1.18 diff -u -u -r1.18 Makefile --- Makefile    6 Jun 2008 
14:02:52 -0000       1.18 +++ Makefile    23 Jun 2008 22:01:22 -0000 @@ 
-30,6 +30,7 @@ 
s@gtk-config@${GTK_CONFIG}@g; s@-lgtk@-lgtk-1.2@g;  
s@-c -g kmem -m 2755 -o root@-s -c -g kmem -m 2755 -o 
root@g"  ${WRKSRC}/Makefile 
+       ${REINPLACE_CMD} -e 's|-lkvm||g' ${WRKSRC}/Makefile.FreeBSD 

post-install: 
${MKDIR} ${EXAMPLESDIR} 
Index: files/patch-sys_freebsd.c 
=================================================================== RCS 
file: files/patch-sys_freebsd.c diff -N files/patch-sys_freebsd.c --- 
/dev/null   1 Jan 1970 00:00:00 -0000 +++ files/patch-sys_freebsd.c   23 
Jun 2008 21:59:58 -0000 @@ -0,0 +1,150 @@ +--- sys_freebsd.c.orig 
2004-05-15 05:44:11.000000000 +0200 ++++ sys_freebsd.c      2008-06-23 
23:59:01.000000000 +0200 +@@ -17,11 +17,7 @@ +  * +  */ + +-#include 
<kvm.h> +-#include <fcntl.h> + #include <sys/types.h> +-#include 
<sys/dkstat.h> +-#include <sys/vmmeter.h> + #include <stdlib.h> + 
#include <stdio.h> + #include <unistd.h> +@@ -35,13 +31,6 @@ + + extern 
BubbleMonData bm; + +-static kvm_t *kd = NULL; +-static struct nlist 
nlst[] = { +-    {"_cp_time", 0}, +-    {"_cnt", 0}, +-    {"_bufspace", 
0}, +-    {0, 0} +-}; + static int pageshift; + + #define pagetob(size) 
((size) << pageshift) +@@ -57,21 +46,6 @@ +       pagesize >>= 1; + 
} + +-    /* open kernel memory */ +-    kd = kvm_open(NULL, NULL, NULL, 
O_RDONLY, "kvm_open"); +- +-    if (kd == NULL) { +-      puts("Could 
not open kernel virtual memory"); +-      return 1; +-    } +- +- 
kvm_nlist(kd, nlst); +- +-    if (nlst[0].n_type == 0 || nlst[1].n_type 
== 0 || nlst[2].n_type == 0) { +-      puts("Error extracting symbols"); 
+-      return 2; +-    } +- +     /* drop setgid & setuid (the latter 
should not be there really) */ +     seteuid(getuid()); + 
setegid(getgid()); +@@ -91,10 +65,10 @@ +     int previous_total, 
previous_load; +     int total, load; +     unsigned long int 
cpu_time[CPUSTATES]; ++    size_t old_len = sizeof(cpu_time); +     int 
i; + +-    if (kvm_read(kd, nlst[0].n_value, &cpu_time, 
sizeof(cpu_time)) +-      != sizeof(cpu_time)) ++ 
if(sysctlbyname("kern.cp_time", &cpu_time, &old_len, NULL, 0)) + 
return 0; + +     load = cpu_time[CP_USER] + cpu_time[CP_SYS] + 
cpu_time[CP_NICE]; +@@ -124,44 +98,57 @@ + { +     u_int64_t 
my_mem_used, my_mem_max; +     u_int64_t my_swap_used, my_swap_max; +- 
struct vmmeter sum; +     int bufspace; ++    int page_count; ++    int 
active_count; ++    int swap_in; ++    int swap_out; ++    size_t 
old_len = sizeof(int); +     static int swappgsin = -1; +     static int 
swappgsout = -1; +     static int swap_firsttime = 1; +     static int 
swapavail = 0, swapused = 0; +     static time_t last_time_swap = 0; + 
time_t curr_time; +- +-    if (kvm_read(kd, nlst[1].n_value, &sum, 
sizeof(sum)) != sizeof(sum)) +-      return 0;               /* _cnt */ 
++    struct xswdev xswp; ++ ++ 
if(sysctlbyname("vm.stats.vm.v_page_count", &page_count, &old_len, NULL, 
0)) ++      return 0; ++ ++ 
if(sysctlbyname("vm.stats.vm.v_active_count", &active_count, &old_len, 
NULL, 0)) ++      return 0; ++ ++    if(sysctlbyname("vfs.bufspace", 
&bufspace, &old_len, NULL, 0)) ++      return 0; ++ ++ 
if(sysctlbyname("vfs.stats.vm.vm_v_swappgsin", &swap_in, &old_len, NULL, 
0)) ++      return 0; + +-    if (kvm_read(kd, nlst[2].n_value, 
&bufspace, sizeof(bufspace)) != +-      sizeof(bufspace)) +-      return 
0;               /* _bufspace */ ++ 
if(sysctlbyname("vfs.stats.vm.vm_v_swappgsout", &swap_out, &old_len, 
NULL, 0)) ++      return 0; + +-    my_mem_max = pagetob((u_int64_t) 
sum.v_page_count); +-    my_mem_used = pagetob((u_int64_t) 
sum.v_active_count); ++    old_len = sizeof(xswp); ++ 
if(sysctlbyname("vm.swapinfo", &xswp, &old_len, NULL, 0)) ++      return 
0; ++ ++    my_mem_max = pagetob((u_int64_t) page_count); ++ 
my_mem_used = pagetob((u_int64_t) active_count); + +     /* only 
calculate when first time or when changes took place */ +     /* do not 
call it more than 1 time per 2 seconds */ +     /* otherwise it can eat 
up to 50% of CPU time on heavy swap activity */ +     curr_time = 
time(NULL); +- ++ +     if (swap_firsttime || +-      (((sum.v_swappgsin 
> swappgsin) || (sum.v_swappgsout > swappgsout)) && ++      (((swap_in > 
swappgsin) || (swap_out > swappgsout)) && +       curr_time > 
last_time_swap + 1)) { + +-      struct kvm_swap swap; +-      int n; +- 
+       swapavail = 0; +       swapused = 0; + +-      n = 
kvm_getswapinfo(kd, &swap, 1, 0); +-      if (n >= 0 && swap.ksw_total 
!= 0) { +-          swapavail = pagetob(swap.ksw_total); +- 
swapused = pagetob(swap.ksw_used); ++      if (xswp.xsw_nblks!= 0) { ++ 
swapavail = pagetob(xswp.xsw_nblks); ++          swapused = 
pagetob(xswp.xsw_used); +       } + +       swap_firsttime = 0; +@@ 
-171,8 +158,8 @@ +     my_swap_used = swapused; +     my_swap_max = 
swapavail; + +-    swappgsin = sum.v_swappgsin; +-    swappgsout = 
sum.v_swappgsout; ++    swappgsin = swap_in; ++    swappgsout = 
swap_out; + +     bm.mem_used = my_mem_used; +     bm.mem_max = 
my_mem_max;
Comment 3 Pietro Cerutti freebsd_committer freebsd_triage 2008-07-09 11:57:38 UTC
State Changed
From-To: feedback->open

bubblemon-dockapp has been fixed.  bubblemon2 not yet.
Comment 4 dfilter service freebsd_committer freebsd_triage 2008-07-09 12:03:42 UTC
gahr        2008-07-09 10:57:24 UTC

  FreeBSD ports repository

  Modified files:
    sysutils/bubblemon-dockapp Makefile 
  Added files:
    sysutils/bubblemon-dockapp/files patch-sys_freebsd.c 
  Log:
  - Migrate kvm -> sysctl
  
  PR:             123068
  Submitted by:   regisr <regisr@pobox.com>
  Approved by:    maintainer timeout (> 2 weeks)
  
  Revision  Changes    Path
  1.19      +2 -1      ports/sysutils/bubblemon-dockapp/Makefile
  1.3       +150 -0    ports/sysutils/bubblemon-dockapp/files/patch-sys_freebsd.c (new)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 5 Pietro Cerutti freebsd_committer freebsd_triage 2008-12-09 12:56:59 UTC
Responsible Changed
From-To: gahr->freebsd-ports-bugs

I can't fix bubblemon2. Back into the pool.
Comment 6 Pietro Cerutti freebsd_committer freebsd_triage 2010-03-15 08:27:03 UTC
Responsible Changed
From-To: freebsd-ports-bugs->gahr

Second trial to fix bubblemon2
Comment 7 Pietro Cerutti freebsd_committer freebsd_triage 2010-06-28 13:56:17 UTC
Responsible Changed
From-To: gahr->freebsd-bugs

Can't fix.
Comment 8 Mark Linimon freebsd_committer freebsd_triage 2010-07-28 03:02:33 UTC
Responsible Changed
From-To: freebsd-ports-bugs->gnats-adm

Maintenance work, please ignore.
Comment 9 Mark Linimon freebsd_committer freebsd_triage 2010-07-28 03:02:52 UTC
Responsible Changed
From-To: gnats-adm->freebsd-ports-bugs

Maintenance work, please ignore.
Comment 10 Martin Wilke freebsd_committer freebsd_triage 2011-02-13 04:23:17 UTC
State Changed
From-To: open->closed

seems is fixed now.