diff options
author | Igor Nabirushkin <inabirushkin@nvidia.com> | 2013-09-24 15:46:16 +0400 |
---|---|---|
committer | Riham Haidar <rhaidar@nvidia.com> | 2013-11-07 12:11:52 -0800 |
commit | e35f1b96133d71434ef7d6910b730f85fe05d2d5 (patch) | |
tree | 7360bc2de6c3fac2715a1ec88817641323aebf06 /drivers | |
parent | a631d021452d987618875c262e7b968f3304eb84 (diff) |
misc: tegra-profiler: send buffer fill count
Tegra Profiler misc driver: transmit the maximum buffer
occupancy to the user space.
Bug 1374266
Change-Id: Id078083a5493552c1f3bb697a1d3e4a5504e3f82
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/309633
(cherry picked from commit 757f16d5b83328d984feb3f37ebe6790fb42d15d)
Reviewed-on: http://git-master/r/325975
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Tested-by: Maxim Morin <mmorin@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/misc/tegra-profiler/comm.c | 7 | ||||
-rw-r--r-- | drivers/misc/tegra-profiler/comm.h | 1 | ||||
-rw-r--r-- | drivers/misc/tegra-profiler/version.h | 2 |
3 files changed, 9 insertions, 1 deletions
diff --git a/drivers/misc/tegra-profiler/comm.c b/drivers/misc/tegra-profiler/comm.c index e7a21ea10495..9273d8ad8991 100644 --- a/drivers/misc/tegra-profiler/comm.c +++ b/drivers/misc/tegra-profiler/comm.c @@ -46,6 +46,7 @@ static void rb_reset(struct quadd_ring_buffer *rb) rb->pos_read = 0; rb->pos_write = 0; rb->fill_count = 0; + rb->max_fill_count = 0; } static int rb_init(struct quadd_ring_buffer *rb, size_t size) @@ -225,6 +226,10 @@ write_sample(struct quadd_record_data *sample, void *extra_data, return; } } + + if (rb->fill_count > rb->max_fill_count) + rb->max_fill_count = rb->fill_count; + spin_unlock_irqrestore(&rb->lock, flags); } @@ -541,6 +546,8 @@ device_ioctl(struct file *file, spin_lock_irqsave(&rb->lock, flags); state.buffer_fill_size = comm_ctx.rb_size - rb_get_free_space(rb); + state.reserved[QUADD_MOD_STATE_IDX_RB_MAX_FILL_COUNT] = + rb->max_fill_count; spin_unlock_irqrestore(&rb->lock, flags); if (copy_to_user((void __user *)ioctl_param, &state, diff --git a/drivers/misc/tegra-profiler/comm.h b/drivers/misc/tegra-profiler/comm.h index e3c7e28719ef..f519f17b317c 100644 --- a/drivers/misc/tegra-profiler/comm.h +++ b/drivers/misc/tegra-profiler/comm.h @@ -32,6 +32,7 @@ struct quadd_ring_buffer { size_t pos_read; size_t pos_write; size_t fill_count; + size_t max_fill_count; }; struct quadd_parameters; diff --git a/drivers/misc/tegra-profiler/version.h b/drivers/misc/tegra-profiler/version.h index 8d2eec0e2c2d..2d55c518b506 100644 --- a/drivers/misc/tegra-profiler/version.h +++ b/drivers/misc/tegra-profiler/version.h @@ -18,7 +18,7 @@ #ifndef __QUADD_VERSION_H #define __QUADD_VERSION_H -#define QUADD_MODULE_VERSION "1.31" +#define QUADD_MODULE_VERSION "1.32" #define QUADD_MODULE_BRANCH "Dev" #endif /* __QUADD_VERSION_H */ |