* Added a new AS_DUMP_BITMAPS command.
* Extended app_server_debug command to be able to send it, too. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39599 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -338,6 +338,7 @@ enum {
|
|||||||
|
|
||||||
// debugging helper
|
// debugging helper
|
||||||
AS_DUMP_ALLOCATOR,
|
AS_DUMP_ALLOCATOR,
|
||||||
|
AS_DUMP_BITMAPS,
|
||||||
|
|
||||||
AS_LAST_CODE
|
AS_LAST_CODE
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2387,6 +2387,7 @@ Desktop::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
|
|||||||
|
|
||||||
case AS_APP_CRASHED:
|
case AS_APP_CRASHED:
|
||||||
case AS_DUMP_ALLOCATOR:
|
case AS_DUMP_ALLOCATOR:
|
||||||
|
case AS_DUMP_BITMAPS:
|
||||||
{
|
{
|
||||||
BAutolock locker(fApplicationsLock);
|
BAutolock locker(fApplicationsLock);
|
||||||
|
|
||||||
|
|||||||
@@ -548,6 +548,23 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
|
|||||||
case AS_DUMP_ALLOCATOR:
|
case AS_DUMP_ALLOCATOR:
|
||||||
fMemoryAllocator.Dump();
|
fMemoryAllocator.Dump();
|
||||||
break;
|
break;
|
||||||
|
case AS_DUMP_BITMAPS:
|
||||||
|
{
|
||||||
|
fMapLocker.Lock();
|
||||||
|
|
||||||
|
debug_printf("Application %ld, %s: %d bitmaps:\n", ClientTeam(),
|
||||||
|
Signature(), (int)fBitmapMap.size());
|
||||||
|
|
||||||
|
BitmapMap::const_iterator iterator = fBitmapMap.begin();
|
||||||
|
for (; iterator != fBitmapMap.end(); iterator++) {
|
||||||
|
ServerBitmap* bitmap = iterator->second;
|
||||||
|
debug_printf(" [%ld] %ldx%ld, area %ld, size %ld\n",
|
||||||
|
bitmap->Token(), bitmap->Width(), bitmap->Height(),
|
||||||
|
bitmap->Area(), bitmap->BitsLength());
|
||||||
|
}
|
||||||
|
fMapLocker.Unlock();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case AS_CREATE_WINDOW:
|
case AS_CREATE_WINDOW:
|
||||||
case AS_CREATE_OFFSCREEN_WINDOW:
|
case AS_CREATE_OFFSCREEN_WINDOW:
|
||||||
|
|||||||
@@ -37,18 +37,48 @@ send_debug_message(team_id team, int32 code)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
usage()
|
||||||
|
{
|
||||||
|
fprintf(stderr, "usage: %s -[ab] <team-id> [...]\n", __progname);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char** argv)
|
main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
if (argc == 1) {
|
if (argc == 1)
|
||||||
fprintf(stderr, "usage: %s <team-id> [...]\n", __progname);
|
usage();
|
||||||
return 1;
|
|
||||||
|
bool dumpAllocator = false;
|
||||||
|
bool dumpBitmaps = false;
|
||||||
|
|
||||||
|
int32 i = 1;
|
||||||
|
while (argv[i][0] == '-') {
|
||||||
|
const char* arg = &argv[i][1];
|
||||||
|
while (arg[0]) {
|
||||||
|
if (arg[0] == 'a')
|
||||||
|
dumpAllocator = true;
|
||||||
|
else if (arg[0] == 'b')
|
||||||
|
dumpBitmaps = true;
|
||||||
|
else
|
||||||
|
usage();
|
||||||
|
|
||||||
|
arg++;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int32 i = 1; i < argc; i++) {
|
for (int32 i = 1; i < argc; i++) {
|
||||||
team_id team = atoi(argv[i]);
|
team_id team = atoi(argv[i]);
|
||||||
if (team > 0)
|
if (team <= 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (dumpAllocator)
|
||||||
send_debug_message(team, AS_DUMP_ALLOCATOR);
|
send_debug_message(team, AS_DUMP_ALLOCATOR);
|
||||||
|
if (dumpBitmaps)
|
||||||
|
send_debug_message(team, AS_DUMP_BITMAPS);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user