Send Linux-ha-cvs mailing list submissions to
        linux-ha-cvs@lists.linux-ha.org

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Linux-ha-cvs digest..."


Today's Topics:

   1. Linux-HA CVS: crm by andrew from 
      (linux-ha-cvs@lists.linux-ha.org)


----------------------------------------------------------------------

Message: 1
Date: Thu,  6 Jul 2006 07:30:25 -0600 (MDT)
From: linux-ha-cvs@lists.linux-ha.org
Subject: [Linux-ha-cvs] Linux-HA CVS: crm by andrew from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : andrew
Host    : 
Project : linux-ha
Module  : crm

Dir     : linux-ha/crm/cib


Modified Files:
        callbacks.c io.c main.c notify.c 


Log Message:
More memory usage changes

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/callbacks.c,v
retrieving revision 1.130
retrieving revision 1.131
diff -u -3 -r1.130 -r1.131
--- callbacks.c 6 Jul 2006 10:55:09 -0000       1.130
+++ callbacks.c 6 Jul 2006 13:30:24 -0000       1.131
@@ -1,4 +1,4 @@
-/* $Id: callbacks.c,v 1.130 2006/07/06 10:55:09 andrew Exp $ */
+/* $Id: callbacks.c,v 1.131 2006/07/06 13:30:24 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -382,7 +382,7 @@
        new_client = cib_client_connect_common(
                channel, cib_channel_ro_synchronous, 
cib_rw_synchronous_callback);
 
-       crm_diff_mem_stats(LOG_ERR, __PRETTY_FUNCTION__, &saved_stats);
+       crm_diff_mem_stats(LOG_ERR, LOG_ERR, __PRETTY_FUNCTION__, NULL, 
&saved_stats);
        if(new_client == NULL) {
                return FALSE;
        }
@@ -398,7 +398,7 @@
        new_client = cib_client_connect_common(
                channel, cib_channel_ro_synchronous, 
cib_ro_synchronous_callback);
 
-       crm_diff_mem_stats(LOG_ERR, __PRETTY_FUNCTION__, &saved_stats);
+       crm_diff_mem_stats(LOG_ERR, LOG_ERR, __PRETTY_FUNCTION__, NULL, 
&saved_stats);
        if(new_client == NULL) {
                return FALSE;
        }
@@ -463,7 +463,7 @@
        send_ipc_message(channel, reg_msg);             
        crm_msg_del(reg_msg);
        
-       crm_diff_mem_stats(LOG_ERR, __PRETTY_FUNCTION__, &saved_stats);
+       crm_diff_mem_stats(LOG_ERR, LOG_ERR, __PRETTY_FUNCTION__, NULL, 
&saved_stats);
        return TRUE;
 }
 
@@ -476,7 +476,7 @@
        new_client = cib_client_connect_common(
                channel, cib_channel_callback, cib_null_callback);
 
-       crm_diff_mem_stats(LOG_ERR, __PRETTY_FUNCTION__, &saved_stats);
+       crm_diff_mem_stats(LOG_ERR, LOG_ERR, __PRETTY_FUNCTION__, NULL, 
&saved_stats);
        if(new_client == NULL) {
                return FALSE;
        }
@@ -490,7 +490,7 @@
        cl_mem_stats_t saved_stats;
        crm_save_mem_stats(__PRETTY_FUNCTION__, &saved_stats);
        result = cib_common_callback(channel, user_data, FALSE, TRUE);
-       crm_diff_mem_stats(LOG_ERR, __PRETTY_FUNCTION__, &saved_stats);
+       crm_diff_mem_stats(LOG_ERR, LOG_WARNING, __PRETTY_FUNCTION__, NULL, 
&saved_stats);
        return result;
 }
 
@@ -502,7 +502,7 @@
        cl_mem_stats_t saved_stats;
        crm_save_mem_stats(__PRETTY_FUNCTION__, &saved_stats);
        result = cib_common_callback(channel, user_data, TRUE, FALSE);
-       crm_diff_mem_stats(LOG_ERR, __PRETTY_FUNCTION__, &saved_stats);
+       crm_diff_mem_stats(LOG_ERR, LOG_WARNING, __PRETTY_FUNCTION__, NULL, 
&saved_stats);
        return result;
 }
 
@@ -513,7 +513,7 @@
        cl_mem_stats_t saved_stats;
        crm_save_mem_stats(__PRETTY_FUNCTION__, &saved_stats);
        result = cib_common_callback(channel, user_data, TRUE, TRUE);
-       crm_diff_mem_stats(LOG_ERR, __PRETTY_FUNCTION__, &saved_stats);
+       crm_diff_mem_stats(LOG_ERR, LOG_WARNING, __PRETTY_FUNCTION__, NULL, 
&saved_stats);
        return result;
 }
 
@@ -524,7 +524,7 @@
        cl_mem_stats_t saved_stats;
        crm_save_mem_stats(__PRETTY_FUNCTION__, &saved_stats);
        result = cib_common_callback(channel, user_data, FALSE, FALSE);
-       crm_diff_mem_stats(LOG_ERR, __PRETTY_FUNCTION__, &saved_stats);
+       crm_diff_mem_stats(LOG_ERR, LOG_WARNING, __PRETTY_FUNCTION__, NULL, 
&saved_stats);
        return result;
 }
 
@@ -660,7 +660,7 @@
                keep_connection = cib_process_disconnect(channel, cib_client);  
        }
        
-       crm_diff_mem_stats(LOG_ERR, __PRETTY_FUNCTION__, &saved_stats);
+       crm_diff_mem_stats(LOG_ERR, LOG_WARNING, __PRETTY_FUNCTION__, NULL, 
&saved_stats);
        return keep_connection;
 }
 
@@ -679,13 +679,6 @@
        longclock_t call_stop = 0;
        longclock_t call_start = 0;
        cl_mem_stats_t saved_stats;
-       cl_mem_stats_t *running_stats = NULL;
-       if(running_stats == NULL) {
-               START_stat_free_op();
-               crm_malloc0(running_stats, sizeof(cl_mem_stats_t));
-               END_stat_free_op();
-               crm_save_mem_stats("running-stats", running_stats);
-       }
        crm_save_mem_stats(__PRETTY_FUNCTION__, &saved_stats);
        
        call_start = time_longclock();
@@ -711,8 +704,7 @@
        call_stop = time_longclock();
        cib_call_time += (call_stop - call_start);
 
-       crm_diff_mem_stats(LOG_ERR, __PRETTY_FUNCTION__, &saved_stats);
-       crm_diff_mem_stats(LOG_ERR, "running-cib-usage", running_stats);
+       crm_diff_mem_stats(LOG_ERR, LOG_WARNING, __PRETTY_FUNCTION__, NULL, 
&saved_stats);
 }
 
 gboolean
@@ -778,7 +770,7 @@
                keep_channel = cib_process_disconnect(channel, cib_client);     
        }
 
-       crm_diff_mem_stats(LOG_DEBUG, __PRETTY_FUNCTION__, &saved_stats);
+       crm_diff_mem_stats(LOG_WARNING, LOG_WARNING, __PRETTY_FUNCTION__, NULL, 
&saved_stats);
        return keep_channel;
 }
 
@@ -827,7 +819,7 @@
                         sync_reply?"":"A-",
                         client_obj?client_obj->name:"<unknown>", 
cib_error2string(local_rc));
        }
-       crm_diff_mem_stats(LOG_ERR, __PRETTY_FUNCTION__, &saved_stats);
+       crm_diff_mem_stats(LOG_ERR, LOG_ERR, __PRETTY_FUNCTION__, NULL, 
&saved_stats);
 }
 
 static void
@@ -975,7 +967,7 @@
                
        } 
        crm_msg_del(forward_msg);
-       crm_diff_mem_stats(LOG_ERR, __PRETTY_FUNCTION__, &saved_stats);
+       crm_diff_mem_stats(LOG_ERR, LOG_ERR, __PRETTY_FUNCTION__, NULL, 
&saved_stats);
 }
 
 static void
@@ -1028,7 +1020,7 @@
        }
        
        crm_msg_del(reply_copy);
-       crm_diff_mem_stats(LOG_ERR, __PRETTY_FUNCTION__, &saved_stats);
+       crm_diff_mem_stats(LOG_ERR, LOG_WARNING, __PRETTY_FUNCTION__, NULL, 
&saved_stats);
 }
        
 void
@@ -1193,8 +1185,8 @@
        crm_msg_del(op_reply);
        free_xml(result_diff);
 
-       if(crm_diff_mem_stats(LOG_ERR, __PRETTY_FUNCTION__, &saved_stats)) {
-               crm_log_message_adv(LOG_ERR,"IPC[leak]", request);
+       if(crm_diff_mem_stats(LOG_ERR, LOG_WARNING, __PRETTY_FUNCTION__, NULL, 
&saved_stats)) {
+               ;/*             crm_log_message_adv(LOG_ERR,"IPC[leak]", 
request); */
        }
        return; 
 }
@@ -1443,7 +1435,7 @@
                }
        }
        
-       crm_diff_mem_stats(LOG_ERR, __PRETTY_FUNCTION__, &saved_stats);
+       crm_diff_mem_stats(LOG_ERR, LOG_ERR, __PRETTY_FUNCTION__, NULL, 
&saved_stats);
        return rc;
 }
 
@@ -1571,7 +1563,7 @@
                initiate_exit();
        }
        
-       crm_diff_mem_stats(LOG_ERR, __PRETTY_FUNCTION__, &saved_stats);
+       crm_diff_mem_stats(LOG_ERR, LOG_ERR, __PRETTY_FUNCTION__, NULL, 
&saved_stats);
        return FALSE;
 }
 
@@ -1591,7 +1583,7 @@
                hb_cluster->llc_ops->rcvmsg(hb_cluster, 0);
        }
        
-       crm_diff_mem_stats(LOG_DEBUG, __PRETTY_FUNCTION__, &saved_stats);
+       crm_diff_mem_stats(LOG_WARNING, LOG_WARNING, __PRETTY_FUNCTION__, NULL, 
&saved_stats);
        return (channel->ch_status == IPC_CONNECT);
 }
 
@@ -1640,7 +1632,7 @@
        
        cib_process_request(msg, FALSE, TRUE, TRUE, NULL);
 
-       crm_diff_mem_stats(LOG_ERR, __PRETTY_FUNCTION__, &saved_stats);
+       crm_diff_mem_stats(LOG_ERR, LOG_ERR, __PRETTY_FUNCTION__, NULL, 
&saved_stats);
        return;
 }
 
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/io.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -3 -r1.74 -r1.75
--- io.c        6 Jul 2006 10:55:09 -0000       1.74
+++ io.c        6 Jul 2006 13:30:24 -0000       1.75
@@ -1,4 +1,4 @@
-/* $Id: io.c,v 1.74 2006/07/06 10:55:09 andrew Exp $ */
+/* $Id: io.c,v 1.75 2006/07/06 13:30:24 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -560,9 +560,14 @@
 
                if(new_bytes != old_bytes) {
                        crm_info("CIB size is %ld bytes (was %ld)", new_bytes, 
old_bytes);
-                       crm_adjust_mem_stats(new_bytes - old_bytes, new_allocs 
- old_allocs,
-                                            new_frees - old_frees);
-               }       
+                       crm_adjust_mem_stats(NULL, new_bytes - old_bytes,
+                                            new_allocs - old_allocs, new_frees 
- old_frees);
+                       if(crm_running_stats != NULL) {
+                               crm_adjust_mem_stats(
+                                       crm_running_stats, new_bytes - 
old_bytes,
+                                       new_allocs - old_allocs, new_frees - 
old_frees);
+                       }
+               }
        }
        
        if(the_cib != saved_cib && the_cib != new_cib) {
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/main.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -3 -r1.47 -r1.48
--- main.c      6 Jul 2006 09:30:28 -0000       1.47
+++ main.c      6 Jul 2006 13:30:24 -0000       1.48
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.47 2006/07/06 09:30:28 andrew Exp $ */
+/* $Id: main.c,v 1.48 2006/07/06 13:30:24 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -147,7 +147,7 @@
 }
 
 unsigned long cib_num_ops = 0;
-const char *cib_stat_interval = "10min";
+const char *cib_stat_interval = "10s";
 unsigned long cib_num_local = 0, cib_num_updates = 0, cib_num_fail = 0;
 unsigned long cib_bad_connects = 0, cib_num_timeouts = 0;
 longclock_t cib_call_time = 0;
@@ -162,6 +162,20 @@
        unsigned int cib_calls_ms = 0;
        static unsigned long cib_stat_interval_ms = 0;
 
+       cl_mem_stats_t saved_stats;
+       if(crm_running_stats == NULL) {
+               START_stat_free_op();
+               crm_malloc0(crm_running_stats, sizeof(cl_mem_stats_t));
+               END_stat_free_op();
+               crm_zero_mem_stats(crm_running_stats);
+       }
+       crm_save_mem_stats(__PRETTY_FUNCTION__, &saved_stats);
+       if(crm_diff_mem_stats(LOG_ERR, LOG_ERR, __PRETTY_FUNCTION__, NULL, 
crm_running_stats)) {
+               crm_err("Total alloc's %ld for %ld bytes",
+                       crm_running_stats->numalloc, 
crm_running_stats->nbytes_alloc);
+       }
+       *crm_running_stats = saved_stats;               
+       
        if(cib_stat_interval_ms == 0) {
                cib_stat_interval_ms = crm_get_msec(cib_stat_interval);
        }
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/notify.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -3 -r1.37 -r1.38
--- notify.c    6 Jul 2006 09:30:28 -0000       1.37
+++ notify.c    6 Jul 2006 13:30:24 -0000       1.38
@@ -1,4 +1,4 @@
-/* $Id: notify.c,v 1.37 2006/07/06 09:30:28 andrew Exp $ */
+/* $Id: notify.c,v 1.38 2006/07/06 13:30:24 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -171,7 +171,7 @@
                crm_debug_3("Client %s/%s not interested in %s notifications",
                            client->name, client->channel_name, type);  
        }
-       crm_diff_mem_stats(LOG_DEBUG, __PRETTY_FUNCTION__, &saved_stats);
+       crm_diff_mem_stats(LOG_DEBUG, LOG_DEBUG, __PRETTY_FUNCTION__, NULL, 
&saved_stats);
 }
 
 void
@@ -226,7 +226,7 @@
        }
                
        crm_msg_del(update_msg);
-       crm_diff_mem_stats(LOG_ERR, __PRETTY_FUNCTION__, &saved_stats);
+       crm_diff_mem_stats(LOG_ERR, LOG_ERR, __PRETTY_FUNCTION__, NULL, 
&saved_stats);
 }
 
 void
@@ -283,7 +283,7 @@
        }
        
        do_cib_notify(options, op, update, result, diff, T_CIB_DIFF_NOTIFY);
-       crm_diff_mem_stats(LOG_ERR, __PRETTY_FUNCTION__, &saved_stats);
+       crm_diff_mem_stats(LOG_ERR, LOG_ERR, __PRETTY_FUNCTION__, NULL, 
&saved_stats);
 }
 
 void
@@ -424,5 +424,5 @@
        
        g_hash_table_foreach(client_list, cib_notify_client, replace_msg);
        crm_msg_del(replace_msg);
-       crm_diff_mem_stats(LOG_ERR, __PRETTY_FUNCTION__, &saved_stats);
+       crm_diff_mem_stats(LOG_ERR, LOG_ERR, __PRETTY_FUNCTION__, NULL, 
&saved_stats);
 }




------------------------------

_______________________________________________
Linux-ha-cvs mailing list
Linux-ha-cvs@lists.linux-ha.org
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs


End of Linux-ha-cvs Digest, Vol 32, Issue 27
********************************************

Reply via email to