perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philippe M. Chiasson" <go...@cpan.org>
Subject [Patch] MP_GTOP=1
Date Mon, 19 May 2003 03:34:30 GMT
# $Id: gtop.patch,v 1.1 2003/05/19 03:29:19 gozer Exp $

Recently tried building with MP_GTOP=1 and noticed that things don't quite
work for me anymore. As per gcc documentation __func__ and __FUNCTION__ should not
be used in string concatenation. Also in modperl_imterp, encountered some
scfg without a valid gtop structure, so create it if not already there.

Index: src/modules/perl/mod_perl.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.c,v
retrieving revision 1.170
diff -u -b -B -I$Id -r1.170 mod_perl.c
--- src/modules/perl/mod_perl.c	2 May 2003 01:35:03 -0000	1.170
+++ src/modules/perl/mod_perl.c	19 May 2003 03:25:48 -0000
@@ -147,8 +147,10 @@
 
 #ifdef MP_USE_GTOP
     MP_TRACE_m_do(
+        if(!scfg->gtop) {
         scfg->gtop = modperl_gtop_new(p);
-        modperl_gtop_do_proc_mem_before(MP_FUNC ": perl_parse");
+        }
+        modperl_gtop_do_proc_mem_before(MP_FUNC);
     );
 #endif
 
@@ -203,7 +205,7 @@
 
 #ifdef MP_USE_GTOP
     MP_TRACE_m_do(
-        modperl_gtop_do_proc_mem_after(MP_FUNC ": perl_parse");
+        modperl_gtop_do_proc_mem_after(MP_FUNC);
     );
 #endif
 
Index: src/modules/perl/modperl_gtop.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_gtop.c,v
retrieving revision 1.7
diff -u -b -B -I$Id -r1.7 modperl_gtop.c
--- src/modules/perl/modperl_gtop.c	15 Mar 2001 01:55:44 -0000	1.7
+++ src/modules/perl/modperl_gtop.c	19 May 2003 03:25:48 -0000
@@ -95,7 +95,7 @@
 }
 
 void modperl_gtop_report_proc_mem(modperl_gtop_t *gtop, 
-                                  char *when, char *msg)
+                                  char *when, const char *msg)
 {
 #define ss_item(item) gtop->proc_mem_ss.item
 
@@ -110,19 +110,19 @@
 #undef ss_item
 }
 
-void modperl_gtop_report_proc_mem_diff(modperl_gtop_t *gtop, char *msg)
+void modperl_gtop_report_proc_mem_diff(modperl_gtop_t *gtop, const char *msg)
 {
     modperl_gtop_proc_mem_size_string(gtop, SS_TYPE_DIFF);
     modperl_gtop_report_proc_mem(gtop, "diff", msg);
 }
 
-void modperl_gtop_report_proc_mem_before(modperl_gtop_t *gtop, char *msg)
+void modperl_gtop_report_proc_mem_before(modperl_gtop_t *gtop, const char *msg)
 {
     modperl_gtop_proc_mem_size_string(gtop, SS_TYPE_BEFORE);
     modperl_gtop_report_proc_mem(gtop, "before", msg);
 }
 
-void modperl_gtop_report_proc_mem_after(modperl_gtop_t *gtop, char *msg)
+void modperl_gtop_report_proc_mem_after(modperl_gtop_t *gtop, const char *msg)
 {
     modperl_gtop_proc_mem_size_string(gtop, SS_TYPE_AFTER);
     modperl_gtop_report_proc_mem(gtop, "after", msg);
Index: src/modules/perl/modperl_gtop.h
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_gtop.h,v
retrieving revision 1.3
diff -u -b -B -I$Id -r1.3 modperl_gtop.h
--- src/modules/perl/modperl_gtop.h	15 Mar 2001 01:55:44 -0000	1.3
+++ src/modules/perl/modperl_gtop.h	19 May 2003 03:25:48 -0000
@@ -36,10 +36,10 @@
 void modperl_gtop_get_proc_mem_before(modperl_gtop_t *gtop);
 void modperl_gtop_get_proc_mem_after(modperl_gtop_t *gtop);
 void modperl_gtop_report_proc_mem(modperl_gtop_t *gtop, 
-                                  char *when, char *msg);
-void modperl_gtop_report_proc_mem_diff(modperl_gtop_t *gtop, char *msg);
-void modperl_gtop_report_proc_mem_before(modperl_gtop_t *gtop, char *msg);
-void modperl_gtop_report_proc_mem_after(modperl_gtop_t *gtop, char *msg);
+                                  char *when, const char *msg);
+void modperl_gtop_report_proc_mem_diff(modperl_gtop_t *gtop, const char *msg);
+void modperl_gtop_report_proc_mem_before(modperl_gtop_t *gtop, const char *msg);
+void modperl_gtop_report_proc_mem_after(modperl_gtop_t *gtop, const char *msg);
 
 #define modperl_gtop_do_proc_mem_before(msg) \
         modperl_gtop_get_proc_mem_before(scfg->gtop); \
Index: src/modules/perl/modperl_interp.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_interp.c,v
retrieving revision 1.58
diff -u -b -B -I$Id -r1.58 modperl_interp.c
--- src/modules/perl/modperl_interp.c	6 Apr 2003 23:49:46 -0000	1.58
+++ src/modules/perl/modperl_interp.c	19 May 2003 03:25:48 -0000
@@ -51,7 +51,10 @@
 #ifdef MP_USE_GTOP
         MP_dSCFG(mip->server);
         MP_TRACE_m_do(
-            modperl_gtop_do_proc_mem_before(MP_FUNC ": perl_clone");
+            if(!scfg->gtop) {
+                 scfg->gtop = modperl_gtop_new(scfg->server->process->pool);
+            }
+            modperl_gtop_do_proc_mem_before(MP_FUNC);
         );
 #endif
 
@@ -99,7 +102,7 @@
 
 #ifdef MP_USE_GTOP
         MP_TRACE_m_do(
-            modperl_gtop_do_proc_mem_after(MP_FUNC ": perl_clone");
+            modperl_gtop_do_proc_mem_after(MP_FUNC);
         );
 #endif
     }


-- 
-- -----------------------------------------------------------------------------
Philippe M. Chiasson /gozer\@(cpan|ectoplasm)\.org/ 88C3A5A5 (122FF51B/C634E37B)
http://gozer.ectoplasm.org/    F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3 A5A5
Q: It is impossible to make anything foolproof because fools are so ingenious.
perl -e'$$=\${gozer};{$_=unpack(P7,pack(L,$$));/^JAm_pH\n$/&&print||$$++&&redo}'

Mime
View raw message