diff options
| author | Poddar, Siddarth <siddpodd@codeaurora.org> | 2018-03-01 18:05:36 +0530 |
|---|---|---|
| committer | Poddar, Siddarth <siddpodd@codeaurora.org> | 2018-03-06 16:52:59 +0530 |
| commit | d74b22b0bb78a1fae72d6360c464544b38b22437 (patch) | |
| tree | d82bdcafababd4185a1a8075e779f2922ca04754 | |
| parent | 01760d99876b88b4ba94b4594ea73a110f5551f4 (diff) | |
qcacmn: Restrict record logging in debugfs file
Do not log the DP trace record in given file if
record size is greater the remaining file size.
CRs-Fixed: 2198359
Change-Id: Ib6b0ddcc796be54231cd3e64ee328e9726d51a27
| -rw-r--r-- | qdf/linux/src/qdf_trace.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/qdf/linux/src/qdf_trace.c b/qdf/linux/src/qdf_trace.c index f13a6fe599d8..f8f5949787e1 100644 --- a/qdf/linux/src/qdf_trace.c +++ b/qdf/linux/src/qdf_trace.c @@ -821,6 +821,8 @@ qdf_export_symbol(qdf_sprint_symbol); #ifdef FEATURE_DP_TRACE #define QDF_DP_TRACE_PREPEND_STR_SIZE 100 +/* one dp trace record can't be greater than 200 bytes*/ +#define QD_DP_TRACE_MAX_RECORD_SIZE 200 static void qdf_dp_unused(struct qdf_dp_trace_record_s *record, uint16_t index, u8 info) { @@ -2358,7 +2360,12 @@ QDF_STATUS qdf_dpt_dump_stats_debugfs(qdf_debugfs_file_t file, p_record = g_qdf_dp_trace_tbl[i]; spin_unlock_bh(&l_dp_trace_lock); for (;; ) { - if ((file->size - file->count) < 100) { + /* + * Initially we get file as 1 page size, and + * if remaining size in file is less than one record max size, + * then return so that it gets an extra page. + */ + if ((file->size - file->count) < QD_DP_TRACE_MAX_RECORD_SIZE) { spin_lock_bh(&l_dp_trace_lock); g_qdf_dp_trace_data.curr_pos = i; spin_unlock_bh(&l_dp_trace_lock); |
