qapi.c (f2687fdb7571a444b5af3509574b659d35ddd601) | qapi.c (54aa3de72ea2aaa2e903e7e879a4f3dda515a00e) |
---|---|
1/* 2 * Block layer qmp and info dump related functions 3 * 4 * Copyright (c) 2003-2008 Fabrice Bellard 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights --- 472 unchanged lines hidden (view full) --- 481 if (ds->has_idle_time_ns) { 482 ds->idle_time_ns = block_acct_idle_time_ns(stats); 483 } 484 485 ds->account_invalid = stats->account_invalid; 486 ds->account_failed = stats->account_failed; 487 488 while ((ts = block_acct_interval_next(stats, ts))) { | 1/* 2 * Block layer qmp and info dump related functions 3 * 4 * Copyright (c) 2003-2008 Fabrice Bellard 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights --- 472 unchanged lines hidden (view full) --- 481 if (ds->has_idle_time_ns) { 482 ds->idle_time_ns = block_acct_idle_time_ns(stats); 483 } 484 485 ds->account_invalid = stats->account_invalid; 486 ds->account_failed = stats->account_failed; 487 488 while ((ts = block_acct_interval_next(stats, ts))) { |
489 BlockDeviceTimedStatsList *timed_stats = 490 g_malloc0(sizeof(*timed_stats)); | |
491 BlockDeviceTimedStats *dev_stats = g_malloc0(sizeof(*dev_stats)); | 489 BlockDeviceTimedStats *dev_stats = g_malloc0(sizeof(*dev_stats)); |
492 timed_stats->next = ds->timed_stats; 493 timed_stats->value = dev_stats; 494 ds->timed_stats = timed_stats; | |
495 496 TimedAverage *rd = &ts->latency[BLOCK_ACCT_READ]; 497 TimedAverage *wr = &ts->latency[BLOCK_ACCT_WRITE]; 498 TimedAverage *fl = &ts->latency[BLOCK_ACCT_FLUSH]; 499 500 dev_stats->interval_length = ts->interval_length; 501 502 dev_stats->min_rd_latency_ns = timed_average_min(rd); --- 7 unchanged lines hidden (view full) --- 510 dev_stats->min_flush_latency_ns = timed_average_min(fl); 511 dev_stats->max_flush_latency_ns = timed_average_max(fl); 512 dev_stats->avg_flush_latency_ns = timed_average_avg(fl); 513 514 dev_stats->avg_rd_queue_depth = 515 block_acct_queue_depth(ts, BLOCK_ACCT_READ); 516 dev_stats->avg_wr_queue_depth = 517 block_acct_queue_depth(ts, BLOCK_ACCT_WRITE); | 490 491 TimedAverage *rd = &ts->latency[BLOCK_ACCT_READ]; 492 TimedAverage *wr = &ts->latency[BLOCK_ACCT_WRITE]; 493 TimedAverage *fl = &ts->latency[BLOCK_ACCT_FLUSH]; 494 495 dev_stats->interval_length = ts->interval_length; 496 497 dev_stats->min_rd_latency_ns = timed_average_min(rd); --- 7 unchanged lines hidden (view full) --- 505 dev_stats->min_flush_latency_ns = timed_average_min(fl); 506 dev_stats->max_flush_latency_ns = timed_average_max(fl); 507 dev_stats->avg_flush_latency_ns = timed_average_avg(fl); 508 509 dev_stats->avg_rd_queue_depth = 510 block_acct_queue_depth(ts, BLOCK_ACCT_READ); 511 dev_stats->avg_wr_queue_depth = 512 block_acct_queue_depth(ts, BLOCK_ACCT_WRITE); |
513 514 QAPI_LIST_PREPEND(ds->timed_stats, dev_stats); |
|
518 } 519 520 bdrv_latency_histogram_stats(&stats->latency_histogram[BLOCK_ACCT_READ], 521 &ds->has_rd_latency_histogram, 522 &ds->rd_latency_histogram); 523 bdrv_latency_histogram_stats(&stats->latency_histogram[BLOCK_ACCT_WRITE], 524 &ds->has_wr_latency_histogram, 525 &ds->wr_latency_histogram); --- 382 unchanged lines hidden --- | 515 } 516 517 bdrv_latency_histogram_stats(&stats->latency_histogram[BLOCK_ACCT_READ], 518 &ds->has_rd_latency_histogram, 519 &ds->rd_latency_histogram); 520 bdrv_latency_histogram_stats(&stats->latency_histogram[BLOCK_ACCT_WRITE], 521 &ds->has_wr_latency_histogram, 522 &ds->wr_latency_histogram); --- 382 unchanged lines hidden --- |