greybus: loopback: rename frequency to requests
The name frequency does not adequately describe the data-point tracking the number of greybus operations performed in a second by the loopback code. Firmware team is moving towards calling this variable requests-per-second or similar. This patch renames to keep the namespace consistent. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Reviewed-by: Patrick Titiano <ptitiano@baylibre.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
e140c75ed9
commit
583cbf50e0
@ -41,7 +41,7 @@ struct gb_loopback {
|
|||||||
|
|
||||||
struct gb_loopback_stats latency;
|
struct gb_loopback_stats latency;
|
||||||
struct gb_loopback_stats throughput;
|
struct gb_loopback_stats throughput;
|
||||||
struct gb_loopback_stats frequency;
|
struct gb_loopback_stats requests_per_second;
|
||||||
struct timeval ts;
|
struct timeval ts;
|
||||||
struct timeval te;
|
struct timeval te;
|
||||||
u64 elapsed_nsecs;
|
u64 elapsed_nsecs;
|
||||||
@ -133,8 +133,8 @@ static void gb_loopback_check_attr(struct gb_loopback *gb)
|
|||||||
|
|
||||||
/* Time to send and receive one message */
|
/* Time to send and receive one message */
|
||||||
gb_loopback_stats_attrs(latency);
|
gb_loopback_stats_attrs(latency);
|
||||||
/* Number of packet sent per second on this cport */
|
/* Number of requests sent per second on this cport */
|
||||||
gb_loopback_stats_attrs(frequency);
|
gb_loopback_stats_attrs(requests_per_second);
|
||||||
/* Quantity of data sent and received on this cport */
|
/* Quantity of data sent and received on this cport */
|
||||||
gb_loopback_stats_attrs(throughput);
|
gb_loopback_stats_attrs(throughput);
|
||||||
/* Number of errors encountered during loop */
|
/* Number of errors encountered during loop */
|
||||||
@ -166,7 +166,7 @@ gb_loopback_attr(iteration_max, u);
|
|||||||
|
|
||||||
static struct attribute *loopback_attrs[] = {
|
static struct attribute *loopback_attrs[] = {
|
||||||
dev_stats_attrs(latency),
|
dev_stats_attrs(latency),
|
||||||
dev_stats_attrs(frequency),
|
dev_stats_attrs(requests_per_second),
|
||||||
dev_stats_attrs(throughput),
|
dev_stats_attrs(throughput),
|
||||||
&dev_attr_type.attr,
|
&dev_attr_type.attr,
|
||||||
&dev_attr_size.attr,
|
&dev_attr_size.attr,
|
||||||
@ -320,7 +320,8 @@ static void gb_loopback_reset_stats(struct gb_loopback *gb)
|
|||||||
};
|
};
|
||||||
memcpy(&gb->latency, &reset, sizeof(struct gb_loopback_stats));
|
memcpy(&gb->latency, &reset, sizeof(struct gb_loopback_stats));
|
||||||
memcpy(&gb->throughput, &reset, sizeof(struct gb_loopback_stats));
|
memcpy(&gb->throughput, &reset, sizeof(struct gb_loopback_stats));
|
||||||
memcpy(&gb->frequency, &reset, sizeof(struct gb_loopback_stats));
|
memcpy(&gb->requests_per_second, &reset,
|
||||||
|
sizeof(struct gb_loopback_stats));
|
||||||
memset(&gb->ts, 0, sizeof(struct timeval));
|
memset(&gb->ts, 0, sizeof(struct timeval));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -336,12 +337,12 @@ static void gb_loopback_update_stats(struct gb_loopback_stats *stats, u64 val)
|
|||||||
do_div(stats->avg, stats->count);
|
do_div(stats->avg, stats->count);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gb_loopback_frequency_update(struct gb_loopback *gb, u32 latency)
|
static void gb_loopback_requests_update(struct gb_loopback *gb, u32 latency)
|
||||||
{
|
{
|
||||||
u32 freq = USEC_PER_SEC;
|
u32 req = USEC_PER_SEC;
|
||||||
|
|
||||||
do_div(freq, latency);
|
do_div(req, latency);
|
||||||
gb_loopback_update_stats(&gb->frequency, freq);
|
gb_loopback_update_stats(&gb->requests_per_second, req);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gb_loopback_throughput_update(struct gb_loopback *gb, u32 latency)
|
static void gb_loopback_throughput_update(struct gb_loopback *gb, u32 latency)
|
||||||
@ -386,9 +387,9 @@ static void gb_loopback_calculate_stats(struct gb_loopback *gb,
|
|||||||
/* Log latency stastic */
|
/* Log latency stastic */
|
||||||
gb_loopback_update_stats(&gb->latency, lat);
|
gb_loopback_update_stats(&gb->latency, lat);
|
||||||
|
|
||||||
/* Log throughput and frequency using latency as benchmark */
|
/* Log throughput and requests using latency as benchmark */
|
||||||
gb_loopback_throughput_update(gb, lat);
|
gb_loopback_throughput_update(gb, lat);
|
||||||
gb_loopback_frequency_update(gb, lat);
|
gb_loopback_requests_update(gb, lat);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int gb_loopback_fn(void *data)
|
static int gb_loopback_fn(void *data)
|
||||||
|
Reference in New Issue
Block a user