Seems only ru_maxrss makes any sense on Linux (BSD has other fields as well), so there isn't much except max RSS watermark.
>>bzr diff ./Percona-Server/sql/sql_profile.cc === modified file 'Percona-Server/sql/sql_profile.cc'
--- Percona-Server/sql/sql_profile.cc 2012-08-07 06:10:00 +0000 +++ Percona-Server/sql/sql_profile.cc 2012-08-30 15:29:31 +0000 @@ -77,6 +77,7 @@ {"SOURCE_FUNCTION", 30, MYSQL_TYPE_STRING, 0, true, "Source_function", SKIP_OPEN_TABLE}, {"SOURCE_FILE", 20, MYSQL_TYPE_STRING, 0, true, "Source_file", SKIP_OPEN_TABLE}, {"SOURCE_LINE", 20, MYSQL_TYPE_LONG, 0, true, "Source_line", SKIP_OPEN_TABLE}, + {"MAXIMUM RESIDENT SET SIZE", 20, MYSQL_TYPE_LONG, 0, true, "Maximum_Resident_Set_Size", SKIP_OPEN_TABLE}, {NULL, 0, MYSQL_TYPE_STRING, 0, true, NULL, 0} };
@@ -103,6 +104,7 @@ profile_options & PROFILE_SOURCE, /* Source_function */ profile_options & PROFILE_SOURCE, /* Source_file */ profile_options & PROFILE_SOURCE, /* Source_line */ + profile_options & PROFILE_MEMORY, /* MEMORY_system */ };
ST_FIELD_INFO *field_info; @@ -839,6 +841,13 @@ table->field[17]->store(previous->line, true); table->field[17]->set_notnull(); } +#ifdef HAVE_GETRUSAGE + table->field[18]->store((uint32)(entry->rusage.ru_maxrss - + previous->rusage.ru_maxrss)); + table->field[18]->set_notnull(); +#else + /* TODO: Add RSS info for non-BSD systems */ +#endif
if (schema_table_store_record(thd_arg, table)) DBUG_RETURN(1);
Seems only ru_maxrss makes any sense on Linux (BSD has other fields as well), so there isn't much except max RSS watermark.
>>bzr diff ./Percona- Server/ sql/sql_ profile. cc Server/ sql/sql_ profile. cc'
=== modified file 'Percona-
--- Percona- Server/ sql/sql_ profile. cc 2012-08-07 06:10:00 +0000 Server/ sql/sql_ profile. cc 2012-08-30 15:29:31 +0000 FUNCTION" , 30, MYSQL_TYPE_STRING, 0, true, "Source_function", SKIP_OPEN_TABLE}, Resident_ Set_Size" , SKIP_OPEN_TABLE},
+++ Percona-
@@ -77,6 +77,7 @@
{"SOURCE_
{"SOURCE_FILE", 20, MYSQL_TYPE_STRING, 0, true, "Source_file", SKIP_OPEN_TABLE},
{"SOURCE_LINE", 20, MYSQL_TYPE_LONG, 0, true, "Source_line", SKIP_OPEN_TABLE},
+ {"MAXIMUM RESIDENT SET SIZE", 20, MYSQL_TYPE_LONG, 0, true, "Maximum_
{NULL, 0, MYSQL_TYPE_STRING, 0, true, NULL, 0}
};
@@ -103,6 +104,7 @@ options & PROFILE_SOURCE, /* Source_function */ options & PROFILE_SOURCE, /* Source_file */ options & PROFILE_SOURCE, /* Source_line */
profile_
profile_
profile_
+ profile_options & PROFILE_MEMORY, /* MEMORY_system */
};
ST_FIELD_INFO *field_info;
table- >field[ 17]->store( previous- >line, true);
table- >field[ 17]->set_ notnull( ); field[18] ->store( (uint32) (entry- >rusage. ru_maxrss - >rusage. ru_maxrss) ); field[18] ->set_notnull( );
@@ -839,6 +841,13 @@
}
+#ifdef HAVE_GETRUSAGE
+ table->
+ previous-
+ table->
+#else
+ /* TODO: Add RSS info for non-BSD systems */
+#endif
if (schema_ table_store_ record( thd_arg, table))
DBUG_ RETURN( 1);