summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2011-02-10 18:37:12 +0100
committerSebastien Helleu <flashcode@flashtux.org>2011-02-10 18:37:12 +0100
commit2ef6fdb2a12fdd9f8689e288340942b7029f9fd3 (patch)
tree3b99652ed2a9461758116cce4eeddd9200a3170e
parentaae8a2e54c087609135868e59698b59b25dd95cb (diff)
downloadweechat-2ef6fdb2a12fdd9f8689e288340942b7029f9fd3.zip
Add option "memory" to command /debug
-rw-r--r--ChangeLog1
-rw-r--r--config.h.cmake1
-rw-r--r--configure.in2
-rw-r--r--doc/de/autogen/user/weechat_commands.txt23
-rw-r--r--doc/en/autogen/user/weechat_commands.txt7
-rw-r--r--doc/fr/autogen/user/weechat_commands.txt7
-rw-r--r--doc/it/autogen/user/weechat_commands.txt7
-rw-r--r--po/cs.po16
-rw-r--r--po/de.po18
-rw-r--r--po/es.po16
-rw-r--r--po/fr.po27
-rw-r--r--po/hu.po16
-rw-r--r--po/it.po16
-rw-r--r--po/pl.po16
-rw-r--r--po/pt_BR.po16
-rw-r--r--po/ru.po16
-rw-r--r--po/weechat.pot16
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/core/wee-command.c24
-rw-r--r--src/core/wee-debug.c34
-rw-r--r--src/core/wee-debug.h1
21 files changed, 206 insertions, 75 deletions
diff --git a/ChangeLog b/ChangeLog
index 4ffb98fd0..eca3858cf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,7 @@ v0.3.5-dev, 2011-02-10
Version 0.3.5 (under dev!)
--------------------------
+* core: add option "memory" to command /debug
* core: add option weechat.look.read_marker_string
* core: improve display of commands lists in /help (add arguments -list
and -listfull) (task #10299)
diff --git a/config.h.cmake b/config.h.cmake
index 984613fe9..50bb9261e 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -21,6 +21,7 @@
#cmakedefine HAVE_BACKTRACE
#cmakedefine ICONV_2ARG_IS_CONST 1
#cmakedefine HAVE_TCL_CREATE_NS
+#cmakedefine HAVE_MALLINFO
#define PACKAGE_VERSION "@VERSION@"
#define PACKAGE "@PROJECT_NAME@"
#define PACKAGE_NAME "@PROJECT_NAME@"
diff --git a/configure.in b/configure.in
index 150348492..665be93e6 100644
--- a/configure.in
+++ b/configure.in
@@ -96,7 +96,7 @@ AC_MSG_RESULT($ac_cv_type_socklen_t)
# Checks for library functions.
AC_FUNC_SELECT_ARGTYPES
AC_TYPE_SIGNAL
-AC_CHECK_FUNCS([gethostbyname gethostname getsockname gettimeofday inet_ntoa memset mkdir select setlocale socket strcasecmp strchr strdup strndup strncasecmp strpbrk strrchr strstr regexec])
+AC_CHECK_FUNCS([gethostbyname gethostname getsockname gettimeofday inet_ntoa memset mkdir select setlocale socket strcasecmp strchr strdup strndup strncasecmp strpbrk strrchr strstr regexec mallinfo])
# Variables in config.h
diff --git a/doc/de/autogen/user/weechat_commands.txt b/doc/de/autogen/user/weechat_commands.txt
index 122ace96b..1df14f4a6 100644
--- a/doc/de/autogen/user/weechat_commands.txt
+++ b/doc/de/autogen/user/weechat_commands.txt
@@ -145,17 +145,18 @@ Erweiterung: Name der Erweiterung ('weechat' für interne WeeChat Befehle)
/debug list
set <plugin> <level>
dump [<plugin>]
- buffer|windows|term|color
-
- list: zeigt alle Erweiterungen mit Debuglevel an
- set: setzt den Level der Protokollierung für eine Erweiterung
- plugin: Name der Erweiterung ("core" für den WeeChat Kern)
- level: Debuglevel der Erweiterung (0 = deaktiviert das Debug)
- dump: Speicherabbild in die WeeChat Protokolldatei schreiben (wie bei einem Programmabsturz)
- buffer: speichert den Bufferinhalt als hexadezimale Ausgabe in die Protokolldatei
-windows: zeigt die Fensterstruktur an
- term: gibt Informationen über das Terminal und verfügbare Farben aus.
- color: zeigt Informationen über die aktuellen Farbpaarungen an.
+ buffer|color|memory|term|windows
+
+ list: list plugins with debug levels
+ set: set debug level for plugin
+ plugin: name of plugin ("core" for WeeChat core)
+ level: debug level for plugin (0 = disable debug)
+ dump: save memory dump in WeeChat log file (same dump is written when WeeChat crashes)
+ buffer: dump buffer content with hexadecimal values in log file
+ color: display infos about current color pairs
+ memory: display infos about memory usage
+ term: display infos about terminal
+windows: display windows tree
........................................
[command]*`filter`* Filterfunktion um Nachrichten in Buffern zu aus- oder einzublenden, dazu können Tags oder regulären Ausdrücken verwendet werden::
diff --git a/doc/en/autogen/user/weechat_commands.txt b/doc/en/autogen/user/weechat_commands.txt
index b4da5a23f..b8c93bc2c 100644
--- a/doc/en/autogen/user/weechat_commands.txt
+++ b/doc/en/autogen/user/weechat_commands.txt
@@ -145,7 +145,7 @@ command: command to execute (a '/' is automatically added if not found at beginn
/debug list
set <plugin> <level>
dump [<plugin>]
- buffer|windows|term|color
+ buffer|color|memory|term|windows
list: list plugins with debug levels
set: set debug level for plugin
@@ -153,9 +153,10 @@ command: command to execute (a '/' is automatically added if not found at beginn
level: debug level for plugin (0 = disable debug)
dump: save memory dump in WeeChat log file (same dump is written when WeeChat crashes)
buffer: dump buffer content with hexadecimal values in log file
-windows: display windows tree
- term: display infos about terminal
color: display infos about current color pairs
+ memory: display infos about memory usage
+ term: display infos about terminal
+windows: display windows tree
........................................
[command]*`filter`* filter messages in buffers, to hide/show them according to tags or regex::
diff --git a/doc/fr/autogen/user/weechat_commands.txt b/doc/fr/autogen/user/weechat_commands.txt
index 635359880..be85e9dfb 100644
--- a/doc/fr/autogen/user/weechat_commands.txt
+++ b/doc/fr/autogen/user/weechat_commands.txt
@@ -145,7 +145,7 @@ extension: nom de l'extension ('weechat' pour une commande interne WeeChat)
/debug list
set <extension> <niveau>
dump [<extension>]
- buffer|windows|term|color
+ buffer|color|memory|term|windows
list: lister les extensions avec leur niveau de debug
set: définir le niveau de debug pour l'extension
@@ -153,9 +153,10 @@ extension: nom de l'extension ("core" pour le coeur de WeeChat)
niveau: niveau de debug pour l'extension
dump: afficher les variables mémoire WeeChat dans le fichier log (les mêmes messages sont affichés lorsque WeeChat plante)
buffer: afficher le contenu du tampon en valeurs hexadécimales dans le fichier log
- windows: afficher l'arbre des fenêtres
- term: afficher des infos sur le terminal
color: afficher des infos sur les paires de couleur courantes
+ memory: afficher des infos sur l'utilisation de la mémoire
+ term: afficher des infos sur le terminal
+ windows: afficher l'arbre des fenêtres
........................................
[command]*`filter`* filtrer les messages dans les tampons, pour les cacher/afficher selon des tags ou expressions régulières::
diff --git a/doc/it/autogen/user/weechat_commands.txt b/doc/it/autogen/user/weechat_commands.txt
index 49dd2e6a4..b11278f48 100644
--- a/doc/it/autogen/user/weechat_commands.txt
+++ b/doc/it/autogen/user/weechat_commands.txt
@@ -145,7 +145,7 @@ comando: comando da eseguire (una '/' viene aggiunta automaticamente se non trov
/debug list
set <plugin> <level>
dump [<plugin>]
- buffer|windows|term|color
+ buffer|color|memory|term|windows
list: list plugins with debug levels
set: set debug level for plugin
@@ -153,9 +153,10 @@ comando: comando da eseguire (una '/' viene aggiunta automaticamente se non trov
level: debug level for plugin (0 = disable debug)
dump: save memory dump in WeeChat log file (same dump is written when WeeChat crashes)
buffer: dump buffer content with hexadecimal values in log file
-windows: display windows tree
- term: display infos about terminal
color: display infos about current color pairs
+ memory: display infos about memory usage
+ term: display infos about terminal
+windows: display windows tree
........................................
[command]*`filter`* filtra messaggi nei buffer, per nascondere/mostrare in base a tag o regexp::
diff --git a/po/cs.po b/po/cs.po
index bc4fcbd7d..bc0a1b6fd 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.5-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-02-08 12:28+0100\n"
+"POT-Creation-Date: 2011-02-10 17:05+0100\n"
"PO-Revision-Date: 2011-02-07 17:29+0100\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1043,7 +1043,8 @@ msgstr "spřáva ladění pro jádro/pluginy"
#, fuzzy
msgid ""
-"list || set <plugin> <level> || dump [<plugin>] || buffer|windows|term|color"
+"list || set <plugin> <level> || dump [<plugin>] || buffer|color|memory|term|"
+"windows"
msgstr "[list | set plugin level | dump | buffer | windows | term]"
#, fuzzy
@@ -1055,9 +1056,10 @@ msgid ""
" dump: save memory dump in WeeChat log file (same dump is written when "
"WeeChat crashes)\n"
" buffer: dump buffer content with hexadecimal values in log file\n"
-"windows: display windows tree\n"
+" color: display infos about current color pairs\n"
+" memory: display infos about memory usage\n"
" term: display infos about terminal\n"
-" color: display infos about current color pairs"
+"windows: display windows tree"
msgstr ""
" set: nastavit úroveň logování pro plugin\n"
" plugin: jméno pluginu (\"core\" pro jádro WeeChat)\n"
@@ -2490,6 +2492,12 @@ msgstr "Znovunačítám konfigurační soubor %s"
msgid "Windows tree:"
msgstr "Strom oken:"
+msgid "Memory usage (see \"man mallinfo\" for help):"
+msgstr ""
+
+msgid "Memory usage not available (function \"mallinfo\" not found)"
+msgstr ""
+
#, c-format
msgid "%sError: another command \"%s\" already exists for plugin \"%s\""
msgstr "%sChyba: příkaz \"%s\" již existuje pro plugin \"%s\""
diff --git a/po/de.po b/po/de.po
index 8338f992a..018e99115 100644
--- a/po/de.po
+++ b/po/de.po
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.5-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-02-09 11:46+0100\n"
+"POT-Creation-Date: 2011-02-10 17:05+0100\n"
"PO-Revision-Date: 2011-02-09 11:49+0100\n"
"Last-Translator: Nils G.\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1070,11 +1070,14 @@ msgstr ""
msgid "control debug for core/plugins"
msgstr "Debug-Kontrolle für Hauptprogramm und/oder Erweiterung"
+#, fuzzy
msgid ""
-"list || set <plugin> <level> || dump [<plugin>] || buffer|windows|term|color"
+"list || set <plugin> <level> || dump [<plugin>] || buffer|color|memory|term|"
+"windows"
msgstr ""
"list || set <plugin> <level> || dump [<plugin>] || buffer|windows|term|color"
+#, fuzzy
msgid ""
" list: list plugins with debug levels\n"
" set: set debug level for plugin\n"
@@ -1083,9 +1086,10 @@ msgid ""
" dump: save memory dump in WeeChat log file (same dump is written when "
"WeeChat crashes)\n"
" buffer: dump buffer content with hexadecimal values in log file\n"
-"windows: display windows tree\n"
+" color: display infos about current color pairs\n"
+" memory: display infos about memory usage\n"
" term: display infos about terminal\n"
-" color: display infos about current color pairs"
+"windows: display windows tree"
msgstr ""
" list: zeigt alle Erweiterungen mit Debuglevel an\n"
" set: setzt den Level der Protokollierung für eine Erweiterung\n"
@@ -2667,6 +2671,12 @@ msgstr "Konfigurationsdatei %s wird erneut geladen"
msgid "Windows tree:"
msgstr "Fensterstruktur:"
+msgid "Memory usage (see \"man mallinfo\" for help):"
+msgstr ""
+
+msgid "Memory usage not available (function \"mallinfo\" not found)"
+msgstr ""
+
#, c-format
msgid "%sError: another command \"%s\" already exists for plugin \"%s\""
msgstr ""
diff --git a/po/es.po b/po/es.po
index f48f755cd..a70a57916 100644
--- a/po/es.po
+++ b/po/es.po
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.5-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-02-08 12:28+0100\n"
+"POT-Creation-Date: 2011-02-10 17:05+0100\n"
"PO-Revision-Date: 2011-02-07 17:29+0100\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1065,7 +1065,8 @@ msgid "control debug for core/plugins"
msgstr "controla los mensajes de depuración para el núcleo/plugins"
msgid ""
-"list || set <plugin> <level> || dump [<plugin>] || buffer|windows|term|color"
+"list || set <plugin> <level> || dump [<plugin>] || buffer|color|memory|term|"
+"windows"
msgstr ""
#, fuzzy
@@ -1077,9 +1078,10 @@ msgid ""
" dump: save memory dump in WeeChat log file (same dump is written when "
"WeeChat crashes)\n"
" buffer: dump buffer content with hexadecimal values in log file\n"
-"windows: display windows tree\n"
+" color: display infos about current color pairs\n"
+" memory: display infos about memory usage\n"
" term: display infos about terminal\n"
-" color: display infos about current color pairs"
+"windows: display windows tree"
msgstr ""
" set: configura el nivel de depuración para plugin\n"
" plugin: nombre del plugin (\"core\" para el núcleo de WeeChat)\n"
@@ -2551,6 +2553,12 @@ msgstr "Recargando archivo de configuración %s"
msgid "Windows tree:"
msgstr "Árbol de ventanas:"
+msgid "Memory usage (see \"man mallinfo\" for help):"
+msgstr ""
+
+msgid "Memory usage not available (function \"mallinfo\" not found)"
+msgstr ""
+
#, c-format
msgid "%sError: another command \"%s\" already exists for plugin \"%s\""
msgstr "%sError: el comando \"%s\" ya existe en el plugin \"%s\""
diff --git a/po/fr.po b/po/fr.po
index bf5c3269a..7e4c57506 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.5-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-02-08 12:28+0100\n"
-"PO-Revision-Date: 2011-02-08 12:29+0100\n"
+"POT-Creation-Date: 2011-02-10 17:05+0100\n"
+"PO-Revision-Date: 2011-02-10 16:46+0100\n"
"Last-Translator: Sebastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: French\n"
@@ -1057,10 +1057,11 @@ msgid "control debug for core/plugins"
msgstr "contrôle du debug pour le coeur/les extensions"
msgid ""
-"list || set <plugin> <level> || dump [<plugin>] || buffer|windows|term|color"
+"list || set <plugin> <level> || dump [<plugin>] || buffer|color|memory|term|"
+"windows"
msgstr ""
-"list || set <extension> <niveau> || dump [<extension>] || buffer|windows|"
-"term|color"
+"list || set <extension> <niveau> || dump [<extension>] || buffer|color|"
+"memory|term|windows"
msgid ""
" list: list plugins with debug levels\n"
@@ -1070,9 +1071,10 @@ msgid ""
" dump: save memory dump in WeeChat log file (same dump is written when "
"WeeChat crashes)\n"
" buffer: dump buffer content with hexadecimal values in log file\n"
-"windows: display windows tree\n"
+" color: display infos about current color pairs\n"
+" memory: display infos about memory usage\n"
" term: display infos about terminal\n"
-" color: display infos about current color pairs"
+"windows: display windows tree"
msgstr ""
" list: lister les extensions avec leur niveau de debug\n"
" set: définir le niveau de debug pour l'extension\n"
@@ -1082,9 +1084,10 @@ msgstr ""
"mêmes messages sont affichés lorsque WeeChat plante)\n"
" buffer: afficher le contenu du tampon en valeurs hexadécimales dans le "
"fichier log\n"
-" windows: afficher l'arbre des fenêtres\n"
+" color: afficher des infos sur les paires de couleur courantes\n"
+" memory: afficher des infos sur l'utilisation de la mémoire\n"
" term: afficher des infos sur le terminal\n"
-" color: afficher des infos sur les paires de couleur courantes"
+" windows: afficher l'arbre des fenêtres"
msgid ""
"filter messages in buffers, to hide/show them according to tags or regex"
@@ -2616,6 +2619,12 @@ msgstr "Rechargement du fichier de configuration %s"
msgid "Windows tree:"
msgstr "Arbre des fenêtres:"
+msgid "Memory usage (see \"man mallinfo\" for help):"
+msgstr "Utilisation mémoire (voir \"man mallinfo\" pour de l'aide) :"
+
+msgid "Memory usage not available (function \"mallinfo\" not found)"
+msgstr "Utilisation mémoire non disponible (fonction \"mallinfo\" non trouvée)"
+
#, c-format
msgid "%sError: another command \"%s\" already exists for plugin \"%s\""
msgstr ""
diff --git a/po/hu.po b/po/hu.po
index af87e2721..42501aab3 100644
--- a/po/hu.po
+++ b/po/hu.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.5-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-02-08 12:28+0100\n"
+"POT-Creation-Date: 2011-02-10 17:05+0100\n"
"PO-Revision-Date: 2011-02-07 17:29+0100\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1017,7 +1017,8 @@ msgstr ""
#, fuzzy
msgid ""
-"list || set <plugin> <level> || dump [<plugin>] || buffer|windows|term|color"
+"list || set <plugin> <level> || dump [<plugin>] || buffer|color|memory|term|"
+"windows"
msgstr "dump | buffer | windows"
#, fuzzy
@@ -1029,9 +1030,10 @@ msgid ""
" dump: save memory dump in WeeChat log file (same dump is written when "
"WeeChat crashes)\n"
" buffer: dump buffer content with hexadecimal values in log file\n"
-"windows: display windows tree\n"
+" color: display infos about current color pairs\n"
+" memory: display infos about memory usage\n"
" term: display infos about terminal\n"
-" color: display infos about current color pairs"
+"windows: display windows tree"
msgstr ""
" dump: memóriatartalom mentése a WeeChat logba (ugyanez a tartalom íródik "
"a WeeChat összeomlásakor)\n"
@@ -2287,6 +2289,12 @@ msgstr "Beállítások mentése a lemezre\n"
msgid "Windows tree:"
msgstr "a /who lista vége"
+msgid "Memory usage (see \"man mallinfo\" for help):"
+msgstr ""
+
+msgid "Memory usage not available (function \"mallinfo\" not found)"
+msgstr ""
+
#, fuzzy, c-format
msgid "%sError: another command \"%s\" already exists for plugin \"%s\""
msgstr "%s az ignore már létezik\n"
diff --git a/po/it.po b/po/it.po
index 7b4955c65..a691980e1 100644
--- a/po/it.po
+++ b/po/it.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.5-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-02-08 12:28+0100\n"
+"POT-Creation-Date: 2011-02-10 17:05+0100\n"
"PO-Revision-Date: 2011-02-07 17:29+0100\n"
"Last-Translator: Marco Paolone <marcopaolone@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1058,7 +1058,8 @@ msgid "control debug for core/plugins"
msgstr "attiva debug per core/plugin"
msgid ""
-"list || set <plugin> <level> || dump [<plugin>] || buffer|windows|term|color"
+"list || set <plugin> <level> || dump [<plugin>] || buffer|color|memory|term|"
+"windows"
msgstr ""
#, fuzzy
@@ -1070,9 +1071,10 @@ msgid ""
" dump: save memory dump in WeeChat log file (same dump is written when "
"WeeChat crashes)\n"
" buffer: dump buffer content with hexadecimal values in log file\n"
-"windows: display windows tree\n"
+" color: display infos about current color pairs\n"
+" memory: display infos about memory usage\n"
" term: display infos about terminal\n"
-" color: display infos about current color pairs"
+"windows: display windows tree"
msgstr ""
" set: imposta il livello di log per il plugin\n"
" plugin: nome del plugin (\"core\" per il core di WeeChat)\n"
@@ -2555,6 +2557,12 @@ msgstr "Ricaricamento del file di configurazione %s"
msgid "Windows tree:"
msgstr "Albero delle finestre:"
+msgid "Memory usage (see \"man mallinfo\" for help):"
+msgstr ""
+
+msgid "Memory usage not available (function \"mallinfo\" not found)"
+msgstr ""
+
#, c-format
msgid "%sError: another command \"%s\" already exists for plugin \"%s\""
msgstr "%sErrore: un altro comando \"%s\" esiste già per il plugin \"%s\""
diff --git a/po/pl.po b/po/pl.po
index 1232d420c..07392c003 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.5-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-02-08 12:28+0100\n"
+"POT-Creation-Date: 2011-02-10 17:05+0100\n"
"PO-Revision-Date: 2011-02-07 17:29+0100\n"
"Last-Translator: Krzysztof Koroscik <soltys@szluug.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1071,7 +1071,8 @@ msgid "control debug for core/plugins"
msgstr "kontrola debugu dla rdzenia/wtyczek"
msgid ""
-"list || set <plugin> <level> || dump [<plugin>] || buffer|windows|term|color"
+"list || set <plugin> <level> || dump [<plugin>] || buffer|color|memory|term|"
+"windows"
msgstr ""
#, fuzzy
@@ -1083,9 +1084,10 @@ msgid ""
" dump: save memory dump in WeeChat log file (same dump is written when "
"WeeChat crashes)\n"
" buffer: dump buffer content with hexadecimal values in log file\n"
-"windows: display windows tree\n"
+" color: display infos about current color pairs\n"
+" memory: display infos about memory usage\n"
" term: display infos about terminal\n"
-" color: display infos about current color pairs"
+"windows: display windows tree"
msgstr ""
" set: ustawia poziom logowania dla wtyczki\n"
" plugin: nazwa wtyczki (\"core\" dla rdzenia WeeChat)\n"
@@ -2549,6 +2551,12 @@ msgstr "Przeładowyanie pliku konfoguracyjnego %s"
msgid "Windows tree:"
msgstr "Drzewo okien:"
+msgid "Memory usage (see \"man mallinfo\" for help):"
+msgstr ""
+
+msgid "Memory usage not available (function \"mallinfo\" not found)"
+msgstr ""
+
#, c-format
msgid "%sError: another command \"%s\" already exists for plugin \"%s\""
msgstr "%sBłąd: istnieje juz inna komenda \"%s\" dla wtyczki \"%s\""
diff --git a/po/pt_BR.po b/po/pt_BR.po
index ec2135ae0..d8e49ef54 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.5-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-02-08 12:28+0100\n"
+"POT-Creation-Date: 2011-02-10 17:05+0100\n"
"PO-Revision-Date: 2011-02-07 17:30+0100\n"
"Last-Translator: Ivan Sichmann Freitas <ivansichfreitas@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1054,7 +1054,8 @@ msgstr "cotrolar depuração para core/plugins"
#, fuzzy
msgid ""
-"list || set <plugin> <level> || dump [<plugin>] || buffer|windows|term|color"
+"list || set <plugin> <level> || dump [<plugin>] || buffer|color|memory|term|"
+"windows"
msgstr "[list | set plugin level | dump [plugin] | buffer | windows | term]"
# find a better translation to dump?
@@ -1068,9 +1069,10 @@ msgid ""
" dump: save memory dump in WeeChat log file (same dump is written when "
"WeeChat crashes)\n"
" buffer: dump buffer content with hexadecimal values in log file\n"
-"windows: display windows tree\n"
+" color: display infos about current color pairs\n"
+" memory: display infos about memory usage\n"
" term: display infos about terminal\n"
-" color: display infos about current color pairs"
+"windows: display windows tree"
msgstr ""
" set: configura o nível de log para o plugin\n"
" plugin: nome do plugin (\"core\" para o core do WeeChat)\n"
@@ -2481,6 +2483,12 @@ msgstr ""
msgid "Windows tree:"
msgstr ""
+msgid "Memory usage (see \"man mallinfo\" for help):"
+msgstr ""
+
+msgid "Memory usage not available (function \"mallinfo\" not found)"
+msgstr ""
+
#, c-format
msgid "%sError: another command \"%s\" already exists for plugin \"%s\""
msgstr ""
diff --git a/po/ru.po b/po/ru.po
index 0611d5b0c..ea6e5526d 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.5-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-02-08 12:28+0100\n"
+"POT-Creation-Date: 2011-02-10 17:05+0100\n"
"PO-Revision-Date: 2011-02-07 17:30+0100\n"
"Last-Translator: Pavel Shevchuk <stlwrt@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1024,7 +1024,8 @@ msgstr ""
#, fuzzy
msgid ""
-"list || set <plugin> <level> || dump [<plugin>] || buffer|windows|term|color"
+"list || set <plugin> <level> || dump [<plugin>] || buffer|color|memory|term|"
+"windows"
msgstr "dump | buffer | windows"
#, fuzzy
@@ -1036,9 +1037,10 @@ msgid ""
" dump: save memory dump in WeeChat log file (same dump is written when "
"WeeChat crashes)\n"
" buffer: dump buffer content with hexadecimal values in log file\n"
-"windows: display windows tree\n"
+" color: display infos about current color pairs\n"
+" memory: display infos about memory usage\n"
" term: display infos about terminal\n"
-" color: display infos about current color pairs"
+"windows: display windows tree"
msgstr ""
" dump: сохранить дамп памяти в журнал WeeChat (аналогично дампу при крахе "
"WeeChat)\n"
@@ -2302,6 +2304,12 @@ msgstr "Сохраняю конфигурацию\n"
msgid "Windows tree:"
msgstr "конец списка /who"
+msgid "Memory usage (see \"man mallinfo\" for help):"
+msgstr ""
+
+msgid "Memory usage not available (function \"mallinfo\" not found)"
+msgstr ""
+
#, fuzzy, c-format
msgid "%sError: another command \"%s\" already exists for plugin \"%s\""
msgstr "%s игнорирование уже существует\n"
diff --git a/po/weechat.pot b/po/weechat.pot
index a40cce9c3..b147fec38 100644
--- a/po/weechat.pot
+++ b/po/weechat.pot
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-02-08 12:28+0100\n"
+"POT-Creation-Date: 2011-02-10 17:05+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -879,7 +879,8 @@ msgid "control debug for core/plugins"
msgstr ""
msgid ""
-"list || set <plugin> <level> || dump [<plugin>] || buffer|windows|term|color"
+"list || set <plugin> <level> || dump [<plugin>] || buffer|color|memory|term|"
+"windows"
msgstr ""
msgid ""
@@ -890,9 +891,10 @@ msgid ""
" dump: save memory dump in WeeChat log file (same dump is written when "
"WeeChat crashes)\n"
" buffer: dump buffer content with hexadecimal values in log file\n"
-"windows: display windows tree\n"
+" color: display infos about current color pairs\n"
+" memory: display infos about memory usage\n"
" term: display infos about terminal\n"
-" color: display infos about current color pairs"
+"windows: display windows tree"
msgstr ""
msgid ""
@@ -1962,6 +1964,12 @@ msgstr ""
msgid "Windows tree:"
msgstr ""
+msgid "Memory usage (see \"man mallinfo\" for help):"
+msgstr ""
+
+msgid "Memory usage not available (function \"mallinfo\" not found)"
+msgstr ""
+
#, c-format
msgid "%sError: another command \"%s\" already exists for plugin \"%s\""
msgstr ""
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 55958fb18..db86c860c 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -61,6 +61,7 @@ CHECK_FUNCTION_EXISTS(strncasecmp HAVE_STRNCASECMP)
CHECK_FUNCTION_EXISTS(strpbrk HAVE_STRPBRK)
CHECK_FUNCTION_EXISTS(strrchr HAVE_STRRCHR)
CHECK_FUNCTION_EXISTS(strstr HAVE_STRSTR)
+CHECK_FUNCTION_EXISTS(mallinfo HAVE_MALLINFO)
CHECK_INCLUDE_FILES("regex.h" HAVE_REGEX_H)
CHECK_FUNCTION_EXISTS(regexec HAVE_REGEXEC)
diff --git a/src/core/wee-command.c b/src/core/wee-command.c
index d0c3be6b2..3f553c0c6 100644
--- a/src/core/wee-command.c
+++ b/src/core/wee-command.c
@@ -1125,17 +1125,21 @@ COMMAND_CALLBACK(debug)
_("Raw content of buffers has been written in log "
"file"));
}
- else if (string_strcasecmp (argv[1], "windows") == 0)
+ else if (string_strcasecmp (argv[1], "color") == 0)
{
- debug_windows_tree ();
+ gui_color_dump (buffer);
+ }
+ else if (string_strcasecmp (argv[1], "memory") == 0)
+ {
+ debug_memory ();
}
else if (string_strcasecmp (argv[1], "term") == 0)
{
gui_window_term_display_infos ();
}
- else if (string_strcasecmp (argv[1], "color") == 0)
+ else if (string_strcasecmp (argv[1], "windows") == 0)
{
- gui_color_dump (buffer);
+ debug_windows_tree ();
}
else if (string_strcasecmp (argv[1], "set") == 0)
{
@@ -4718,7 +4722,7 @@ command_init ()
N_("list"
" || set <plugin> <level>"
" || dump [<plugin>]"
- " || buffer|windows|term|color"),
+ " || buffer|color|memory|term|windows"),
N_(" list: list plugins with debug levels\n"
" set: set debug level for plugin\n"
" plugin: name of plugin (\"core\" for WeeChat core)\n"
@@ -4727,16 +4731,18 @@ command_init ()
"dump is written when WeeChat crashes)\n"
" buffer: dump buffer content with hexadecimal values "
"in log file\n"
- "windows: display windows tree\n"
+ " color: display infos about current color pairs\n"
+ " memory: display infos about memory usage\n"
" term: display infos about terminal\n"
- " color: display infos about current color pairs"),
+ "windows: display windows tree"),
"list"
" || set %(plugins_names)|core"
" || dump %(plugins_names)|core"
" || buffer"
- " || windows"
+ " || color"
+ " || memory"
" || term"
- " || color",
+ " || windows",
&command_debug, NULL);
hook_command (NULL, "filter",
N_("filter messages in buffers, to hide/show them according "
diff --git a/src/core/wee-debug.c b/src/core/wee-debug.c
index b0c90eba7..fe75431d0 100644
--- a/src/core/wee-debug.c
+++ b/src/core/wee-debug.c
@@ -26,6 +26,9 @@
#endif
#include <stdlib.h>
+#ifdef HAVE_MALLINFO
+#include <malloc.h>
+#endif
#include "weechat.h"
#include "wee-backtrace.h"
@@ -257,6 +260,37 @@ debug_windows_cb (void *data, const char *signal, const char *type_data,
}
/*
+ * debug_memory: display information about dynamic memory allocation
+ */
+
+void
+debug_memory ()
+{
+#ifdef HAVE_MALLINFO
+ struct mallinfo info;
+
+ info = mallinfo ();
+
+ gui_chat_printf (NULL, "");
+ gui_chat_printf (NULL, _("Memory usage (see \"man mallinfo\" for help):"));
+ gui_chat_printf (NULL, " arena :%10d", info.arena);
+ gui_chat_printf (NULL, " ordblks :%10d", info.ordblks);
+ gui_chat_printf (NULL, " smblks :%10d", info.smblks);
+ gui_chat_printf (NULL, " hblks :%10d", info.hblks);
+ gui_chat_printf (NULL, " hblkhd :%10d", info.hblkhd);
+ gui_chat_printf (NULL, " usmblks :%10d", info.usmblks);
+ gui_chat_printf (NULL, " fsmblks :%10d", info.fsmblks);
+ gui_chat_printf (NULL, " uordblks:%10d", info.uordblks);
+ gui_chat_printf (NULL, " fordblks:%10d", info.fordblks);
+ gui_chat_printf (NULL, " keepcost:%10d", info.keepcost);
+#else
+ gui_chat_printf (NULL,
+ _("Memory usage not available (function \"mallinfo\" not "
+ "found)"));
+#endif
+}
+
+/*
* debug_init: hook signals for debug
*/
diff --git a/src/core/wee-debug.h b/src/core/wee-debug.h
index b3f84b901..652ede38b 100644
--- a/src/core/wee-debug.h
+++ b/src/core/wee-debug.h
@@ -24,6 +24,7 @@ struct t_gui_window_tree;
extern void debug_sigsegv ();
extern void debug_windows_tree ();
+extern void debug_memory ();
extern void debug_init ();
#endif /* __WEECHAT_DEBUG_H */