qcacmn: Add qdf api support for mtrace logging

Currently mtrace messages are getting recorded in circular
queue but are not getting used for DIAG Infrastructure.
Add support to print the mtrace messages on DIAG infrastructure in
format such that there will be two 32 bit fields printed on the
logs. These two fields will be constructed as explained below:
1. First field will be constructed using below bit positions:
   a. Bit 0 – 14 ( 15 Bits Lsb ) will contain the messageIDs
   b. The bit 15-22 will represent the destination module,
      and the 23-30 will represent the source module which is
      initiating the message.
   c. Bit 31 will represent whether the message is from host
      or from FW. If bit is 0, it indicates the message is
      from host and if it is 1 it indicates the message is
      from FW.
2. Second field will be constructed using below bit positions:
   a. First 16 bits (From LSB )will be used for counter.
   b. Next 8 bits would be the vdev id.
   c. Remaining 8 bits are reserved for future use.

Here counter is static unsigned 16 bit value which will be
used to keep track of number of logs given to QXDM and out of
these logs how many logs have been missed.

Change-Id: I4cec762ef17222d6adda9fd3e283c101afb92955
CRs-Fixed: 2290898
このコミットが含まれているのは:
Ashish Kumar Dhanotiya
2018-06-26 16:57:40 +05:30
committed by nshrivas
コミット 27bcaf88dd
2個のファイルの変更78行の追加1行の削除

ファイルの表示

@@ -514,7 +514,7 @@ qdf_export_symbol(qdf_trace_deinit);
/**
* qdf_trace() - puts the messages in to ring-buffer
* @module: Enum of module, basically module id.
* @param: Code to be recorded
* @code: Code to be recorded
* @session: Session ID of the log
* @data: Actual message contents
*
@@ -580,6 +580,32 @@ void qdf_trace(uint8_t module, uint8_t code, uint16_t session, uint32_t data)
}
qdf_export_symbol(qdf_trace);
#ifdef ENABLE_MTRACE_LOG
void qdf_mtrace_log(QDF_MODULE_ID src_module, QDF_MODULE_ID dst_module,
uint16_t message_id, uint8_t vdev_id)
{
uint32_t trace_log, payload;
static uint16_t counter;
trace_log = (src_module << 23) | (dst_module << 15) | message_id;
payload = (vdev_id << 16) | counter++;
QDF_TRACE(src_module, QDF_TRACE_LEVEL_TRACE, "%x %x",
trace_log, payload);
}
qdf_export_symbol(qdf_mtrace_log);
#endif
void qdf_mtrace(QDF_MODULE_ID src_module, QDF_MODULE_ID dst_module,
uint16_t message_id, uint8_t vdev_id, uint32_t data)
{
qdf_trace(src_module, message_id, vdev_id, data);
qdf_mtrace_log(src_module, dst_module, message_id, vdev_id);
}
qdf_export_symbol(qdf_mtrace);
/**
* qdf_trace_spin_lock_init() - initializes the lock variable before use
*