DebugAnalyzer: Fix 64 bit build.
This commit is contained in:
parent
36ab52c74e
commit
883b3e1d5c
@ -38,11 +38,11 @@ printf("ReadyToRun()\n");
|
||||
PostMessage(B_QUIT_REQUESTED);
|
||||
}
|
||||
|
||||
virtual void ArgvReceived(int32 argc, char** argv)
|
||||
virtual void ArgvReceived(int32 argc, char** argv)
|
||||
{
|
||||
printf("ArgvReceived()\n");
|
||||
for (int32 i = 0; i < argc; i++)
|
||||
printf(" arg %ld: \"%s\"\n", i, argv[i]);
|
||||
printf("ArgvReceived()\n");
|
||||
for (int32 i = 0; i < argc; i++)
|
||||
printf(" arg %" B_PRId32 ": \"%s\"\n", i, argv[i]);
|
||||
|
||||
for (int32 i = 1; i < argc; i++) {
|
||||
PathDataSource* dataSource = new(std::nothrow) PathDataSource;
|
||||
|
@ -59,7 +59,7 @@ BigtimeChartAxisLegendSource::GetAxisLegends(const ChartDataRange& range,
|
||||
decomposed_bigtime decomposed;
|
||||
decompose_time(time, decomposed);
|
||||
char buffer[128];
|
||||
snprintf(buffer, sizeof(buffer), "%02lld:%02d:%02d.%06d",
|
||||
snprintf(buffer, sizeof(buffer), "%02" B_PRIu64 ":%02d:%02d.%06d",
|
||||
decomposed.hours, decomposed.minutes, decomposed.seconds,
|
||||
decomposed.micros);
|
||||
// TODO: Drop superfluous micro seconds digits, or even microseconds and seconds
|
||||
|
@ -89,7 +89,7 @@ LegendChartAxis::_FilterLegends(int32 totalSize, int32 spacing,
|
||||
// Filter out all higher level legends colliding with lower level or
|
||||
// preceeding same-level legends. We iterate backwards from the lower to
|
||||
// the higher levels
|
||||
for (int32 level = std::max(minLevel, 0L); level <= maxLevel;) {
|
||||
for (int32 level = std::max(minLevel, (int32)0); level <= maxLevel;) {
|
||||
legendCount = fLegends.CountItems();
|
||||
|
||||
// get the first legend position/end
|
||||
|
@ -60,7 +60,7 @@ NanotimeChartAxisLegendSource::GetAxisLegends(const ChartDataRange& range,
|
||||
decomposed_nanotime decomposed;
|
||||
decompose_time(time, decomposed);
|
||||
char buffer[128];
|
||||
snprintf(buffer, sizeof(buffer), "%02lld:%02d:%02d.%09d",
|
||||
snprintf(buffer, sizeof(buffer), "%02" B_PRId64 ":%02d:%02d.%09d",
|
||||
decomposed.hours, decomposed.minutes, decomposed.seconds,
|
||||
decomposed.nanos);
|
||||
// TODO: Drop superfluous nanoseconds digits, or even nanoseconds and seconds
|
||||
|
@ -68,11 +68,11 @@ MainWindow::GeneralPage::SetModel(Model* model)
|
||||
fIdleTimeView->SetText(buffer);
|
||||
|
||||
// team count
|
||||
snprintf(buffer, sizeof(buffer), "%ld", fModel->CountTeams());
|
||||
snprintf(buffer, sizeof(buffer), "%" B_PRId32, fModel->CountTeams());
|
||||
fTeamCountView->SetText(buffer);
|
||||
|
||||
// threads
|
||||
snprintf(buffer, sizeof(buffer), "%ld", fModel->CountThreads());
|
||||
snprintf(buffer, sizeof(buffer), "%" B_PRId32, fModel->CountThreads());
|
||||
fThreadCountView->SetText(buffer);
|
||||
} else {
|
||||
fDataSourceView->SetText("");
|
||||
|
@ -318,7 +318,7 @@ protected:
|
||||
int32 lineHeight = (int32)fFontInfo.lineHeight;
|
||||
minLine = (int32)rect.top / lineHeight;
|
||||
maxLine = ((int32)ceilf(rect.bottom) + lineHeight - 1) / lineHeight;
|
||||
minLine = std::max(minLine, 0L);
|
||||
minLine = std::max(minLine, (int32)0);
|
||||
maxLine = std::min(maxLine, CountLines() - 1);
|
||||
}
|
||||
|
||||
@ -1449,7 +1449,8 @@ printf("failed to read event!\n");
|
||||
Model::ThreadSchedulingState* thread = fState.LookupThread(
|
||||
event->thread);
|
||||
if (thread == NULL) {
|
||||
printf("Schedule event for unknown thread: %ld\n", event->thread);
|
||||
printf("Schedule event for unknown thread: %" B_PRId32 "\n",
|
||||
event->thread);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1464,8 +1465,8 @@ printf("failed to read event!\n");
|
||||
|
||||
thread = fState.LookupThread(event->previous_thread);
|
||||
if (thread == NULL) {
|
||||
printf("Schedule event for unknown previous thread: %ld\n",
|
||||
event->previous_thread);
|
||||
printf("Schedule event for unknown previous thread: %" B_PRId32
|
||||
"\n", event->previous_thread);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1529,8 +1530,8 @@ printf("failed to read event!\n");
|
||||
Model::ThreadSchedulingState* thread = fState.LookupThread(
|
||||
event->thread);
|
||||
if (thread == NULL) {
|
||||
printf("Enqueued in run queue event for unknown thread: %ld\n",
|
||||
event->thread);
|
||||
printf("Enqueued in run queue event for unknown thread: %" B_PRId32
|
||||
"\n", event->thread);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1559,8 +1560,8 @@ printf("failed to read event!\n");
|
||||
Model::ThreadSchedulingState* thread = fState.LookupThread(
|
||||
event->thread);
|
||||
if (thread == NULL) {
|
||||
printf("Removed from run queue event for unknown thread: %ld\n",
|
||||
event->thread);
|
||||
printf("Removed from run queue event for unknown thread: %" B_PRId32
|
||||
"\n", event->thread);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -51,8 +51,8 @@ public:
|
||||
{
|
||||
char buffer[128];
|
||||
Model::Team* team = thread->GetTeam();
|
||||
snprintf(buffer, sizeof(buffer), "%s (%ld)", team->Name(),
|
||||
team->ID());
|
||||
snprintf(buffer, sizeof(buffer), "%s (%" B_PRId32 ")",
|
||||
team->Name(), team->ID());
|
||||
value.SetTo(buffer);
|
||||
return true;
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ ThreadWindow::GeneralPage::SetModel(Model* model, Model::Thread* thread)
|
||||
|
||||
// ID
|
||||
char buffer[128];
|
||||
snprintf(buffer, sizeof(buffer), "%ld", fThread->ID());
|
||||
snprintf(buffer, sizeof(buffer), "%" B_PRId32, fThread->ID());
|
||||
fThreadIDView->SetText(buffer);
|
||||
|
||||
// team
|
||||
@ -65,28 +65,28 @@ ThreadWindow::GeneralPage::SetModel(Model* model, Model::Thread* thread)
|
||||
char timeBuffer[64];
|
||||
format_nanotime(fThread->TotalRunTime(), timeBuffer,
|
||||
sizeof(timeBuffer));
|
||||
snprintf(buffer, sizeof(buffer), "%s (%lld)", timeBuffer,
|
||||
snprintf(buffer, sizeof(buffer), "%s (%" B_PRId64 ")", timeBuffer,
|
||||
fThread->Runs());
|
||||
fRunTimeView->SetText(buffer);
|
||||
|
||||
// wait time
|
||||
format_nanotime(fThread->TotalWaitTime(), timeBuffer,
|
||||
sizeof(timeBuffer));
|
||||
snprintf(buffer, sizeof(buffer), "%s (%lld)", timeBuffer,
|
||||
snprintf(buffer, sizeof(buffer), "%s (%" B_PRId64 ")", timeBuffer,
|
||||
fThread->Waits());
|
||||
fWaitTimeView->SetText(buffer);
|
||||
|
||||
// latencies
|
||||
format_nanotime(fThread->TotalLatency(), timeBuffer,
|
||||
sizeof(timeBuffer));
|
||||
snprintf(buffer, sizeof(buffer), "%s (%lld)", timeBuffer,
|
||||
snprintf(buffer, sizeof(buffer), "%s (%" B_PRId64 ")", timeBuffer,
|
||||
fThread->Latencies());
|
||||
fLatencyView->SetText(buffer);
|
||||
|
||||
// preemptions
|
||||
format_nanotime(fThread->TotalRerunTime(), timeBuffer,
|
||||
sizeof(timeBuffer));
|
||||
snprintf(buffer, sizeof(buffer), "%s (%lld)", timeBuffer,
|
||||
snprintf(buffer, sizeof(buffer), "%s (%" B_PRId64 ")", timeBuffer,
|
||||
fThread->Preemptions());
|
||||
fPreemptionView->SetText(buffer);
|
||||
|
||||
|
@ -27,8 +27,8 @@ static BString
|
||||
get_window_name(Model::Thread* thread)
|
||||
{
|
||||
char buffer[1024];
|
||||
snprintf(buffer, sizeof(buffer), "Thread: %s (%ld)", thread->Name(),
|
||||
thread->ID());
|
||||
snprintf(buffer, sizeof(buffer), "Thread: %s (%" B_PRId32 ")",
|
||||
thread->Name(), thread->ID());
|
||||
return BString(buffer);
|
||||
}
|
||||
|
||||
|
@ -785,7 +785,7 @@ Model::AddTeam(const system_profiler_team_added* event, nanotime_t time)
|
||||
{
|
||||
Team* team = TeamByID(event->team);
|
||||
if (team != NULL) {
|
||||
fprintf(stderr, "Duplicate team: %ld\n", event->team);
|
||||
fprintf(stderr, "Duplicate team: %" B_PRId32 "\n", event->team);
|
||||
// TODO: User feedback!
|
||||
return team;
|
||||
}
|
||||
@ -830,7 +830,7 @@ Model::AddThread(const system_profiler_thread_added* event, nanotime_t time)
|
||||
// check whether we do already know the thread
|
||||
Thread* thread = ThreadByID(event->thread);
|
||||
if (thread != NULL) {
|
||||
fprintf(stderr, "Duplicate thread: %ld\n", event->thread);
|
||||
fprintf(stderr, "Duplicate thread: %" B_PRId32 "\n", event->thread);
|
||||
// TODO: User feedback!
|
||||
return thread;
|
||||
}
|
||||
@ -838,7 +838,7 @@ Model::AddThread(const system_profiler_thread_added* event, nanotime_t time)
|
||||
// get its team
|
||||
Team* team = TeamByID(event->team);
|
||||
if (team == NULL) {
|
||||
fprintf(stderr, "No team for thread: %ld\n", event->thread);
|
||||
fprintf(stderr, "No team for thread: %" B_PRId32 "\n", event->thread);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -721,9 +721,9 @@ ModelLoader::_ProcessEvent(uint32 event, uint32 cpu, const void* buffer,
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("unsupported event type %lu, size: %lu\n", event, size);
|
||||
return B_BAD_DATA;
|
||||
break;
|
||||
printf("unsupported event type %" B_PRIu32 ", size: %" B_PRIuSIZE
|
||||
"\n", event, size);
|
||||
return B_BAD_DATA;
|
||||
}
|
||||
|
||||
return B_OK;
|
||||
@ -889,8 +889,10 @@ ModelLoader::_HandleTeamRemoved(system_profiler_team_removed* event)
|
||||
{
|
||||
if (Model::Team* team = fModel->TeamByID(event->team))
|
||||
team->SetDeletionTime(fState->LastEventTime());
|
||||
else
|
||||
printf("Warning: Removed event for unknown team: %ld\n", event->team);
|
||||
else {
|
||||
printf("Warning: Removed event for unknown team: %" B_PRId32 "\n",
|
||||
event->team);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -913,7 +915,7 @@ ModelLoader::_HandleThreadRemoved(system_profiler_thread_removed* event)
|
||||
{
|
||||
ExtendedThreadSchedulingState* thread = fState->LookupThread(event->thread);
|
||||
if (thread == NULL) {
|
||||
printf("Warning: Removed event for unknown thread: %ld\n",
|
||||
printf("Warning: Removed event for unknown thread: %" B_PRId32 "\n",
|
||||
event->thread);
|
||||
thread = _AddUnknownThread(event->thread);
|
||||
}
|
||||
@ -931,7 +933,7 @@ ModelLoader::_HandleThreadScheduled(uint32 cpu,
|
||||
|
||||
ExtendedThreadSchedulingState* thread = fState->LookupThread(event->thread);
|
||||
if (thread == NULL) {
|
||||
printf("Warning: Schedule event for unknown thread: %ld\n",
|
||||
printf("Warning: Schedule event for unknown thread: %" B_PRId32 "\n",
|
||||
event->thread);
|
||||
thread = _AddUnknownThread(event->thread);
|
||||
return;
|
||||
@ -966,8 +968,8 @@ ModelLoader::_HandleThreadScheduled(uint32 cpu,
|
||||
|
||||
thread = fState->LookupThread(event->previous_thread);
|
||||
if (thread == NULL) {
|
||||
printf("Warning: Schedule event for unknown previous thread: %ld\n",
|
||||
event->previous_thread);
|
||||
printf("Warning: Schedule event for unknown previous thread: %" B_PRId32
|
||||
"\n", event->previous_thread);
|
||||
thread = _AddUnknownThread(event->previous_thread);
|
||||
}
|
||||
|
||||
@ -1035,8 +1037,8 @@ ModelLoader::_HandleThreadEnqueuedInRunQueue(
|
||||
|
||||
ExtendedThreadSchedulingState* thread = fState->LookupThread(event->thread);
|
||||
if (thread == NULL) {
|
||||
printf("Warning: Enqueued in run queue event for unknown thread: %ld\n",
|
||||
event->thread);
|
||||
printf("Warning: Enqueued in run queue event for unknown thread: %"
|
||||
B_PRId32 "\n", event->thread);
|
||||
thread = _AddUnknownThread(event->thread);
|
||||
}
|
||||
|
||||
@ -1073,7 +1075,7 @@ ModelLoader::_HandleThreadRemovedFromRunQueue(uint32 cpu,
|
||||
ExtendedThreadSchedulingState* thread = fState->LookupThread(event->thread);
|
||||
if (thread == NULL) {
|
||||
printf("Warning: Removed from run queue event for unknown thread: "
|
||||
"%ld\n", event->thread);
|
||||
"%" B_PRId32 "\n", event->thread);
|
||||
thread = _AddUnknownThread(event->thread);
|
||||
}
|
||||
|
||||
@ -1112,8 +1114,8 @@ ModelLoader::_HandleIOSchedulerAdded(system_profiler_io_scheduler_added* event)
|
||||
{
|
||||
Model::IOScheduler* scheduler = fModel->IOSchedulerByID(event->scheduler);
|
||||
if (scheduler != NULL) {
|
||||
printf("Warning: Duplicate added event for I/O scheduler %ld\n",
|
||||
event->scheduler);
|
||||
printf("Warning: Duplicate added event for I/O scheduler %" B_PRId32
|
||||
"\n", event->scheduler);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1134,12 +1136,13 @@ ModelLoader::_HandleIORequestScheduled(io_request_scheduled* event)
|
||||
|
||||
ExtendedThreadSchedulingState* thread = fState->LookupThread(event->thread);
|
||||
if (thread == NULL) {
|
||||
printf("Warning: I/O request for unknown thread %ld\n", event->thread);
|
||||
printf("Warning: I/O request for unknown thread %" B_PRId32 "\n",
|
||||
event->thread);
|
||||
thread = _AddUnknownThread(event->thread);
|
||||
}
|
||||
|
||||
if (fModel->IOSchedulerByID(event->scheduler) == NULL) {
|
||||
printf("Warning: I/O requests for unknown scheduler %ld\n",
|
||||
printf("Warning: I/O requests for unknown scheduler %" B_PRId32 "\n",
|
||||
event->scheduler);
|
||||
// TODO: Add state for unknown scheduler, as we do for threads.
|
||||
return;
|
||||
@ -1307,8 +1310,8 @@ ModelLoader::_AddThreadWaitObject(ExtendedThreadSchedulingState* thread,
|
||||
= fModel->WaitObjectGroupFor(type, object);
|
||||
if (waitObjectGroup == NULL) {
|
||||
// The algorithm should prevent this case.
|
||||
printf("ModelLoader::_AddThreadWaitObject(): Unknown wait object: type: %lu, "
|
||||
"object: %#lx\n", type, object);
|
||||
printf("ModelLoader::_AddThreadWaitObject(): Unknown wait object: type:"
|
||||
" %" B_PRIu32 ", " "object: %#" B_PRIxADDR "\n", type, object);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -114,9 +114,9 @@ ThreadModelLoader::_Load()
|
||||
|
||||
// create the groups
|
||||
int32 waitObjectCount = waitObjects.CountItems();
|
||||
printf("%ld wait objects\n", waitObjectCount);
|
||||
printf("%" B_PRId32 " wait objects\n", waitObjectCount);
|
||||
for (int32 i = 0; i < waitObjectCount;) {
|
||||
printf("new wait object group at %ld\n", i);
|
||||
printf("new wait object group at %" B_PRId32 "\n", i);
|
||||
// collect the objects for this group
|
||||
Model::ThreadWaitObject* firstObject = waitObjects.ItemAt(i);
|
||||
int32 k = i + 1;
|
||||
|
Loading…
Reference in New Issue
Block a user