Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame^] | 2 | * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3 | * |
| 4 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 5 | * |
| 6 | * |
| 7 | * Permission to use, copy, modify, and/or distribute this software for |
| 8 | * any purpose with or without fee is hereby granted, provided that the |
| 9 | * above copyright notice and this permission notice appear in all |
| 10 | * copies. |
| 11 | * |
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 13 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 15 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 16 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 17 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 18 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 19 | * PERFORMANCE OF THIS SOFTWARE. |
| 20 | */ |
| 21 | |
| 22 | /* |
| 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
| 26 | */ |
| 27 | |
| 28 | #ifdef HDD_TRACE_RECORD |
| 29 | |
| 30 | /** |
| 31 | * DOC: wlan_hdd_trace.c |
| 32 | * |
| 33 | * WLAN Host Device Driver trace implementation |
| 34 | * |
| 35 | */ |
| 36 | |
| 37 | #include "cdf_trace.h" |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame^] | 38 | #include "qdf_types.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 39 | #include "wlan_hdd_trace.h" |
| 40 | #include "wlan_hdd_main.h" |
| 41 | |
| 42 | /** |
| 43 | * hdd_trace_dump() - Dump an HDD-specific trace record |
| 44 | * @mac: (unused) global MAC handle |
| 45 | * @record: trace record that was previously recorded |
| 46 | * @index: index of the trace record |
| 47 | * |
| 48 | * Return: none |
| 49 | */ |
| 50 | static void |
| 51 | hdd_trace_dump(void *mac, tp_cdf_trace_record record, uint16_t index) |
| 52 | { |
Sreelakshmi Konamki | c88f537 | 2015-12-22 12:50:15 +0530 | [diff] [blame] | 53 | if (TRACE_CODE_HDD_RX_SME_MSG == record->code) |
| 54 | hddLog(LOGE, "%04d %012llu S%d %-14s %-30s(0x%x) ", |
| 55 | index, record->time, record->session, "RX SME MSG:", |
| 56 | get_e_roam_cmd_status_str(record->data), record->data); |
| 57 | else |
| 58 | hddLog(LOGE, "%04d %012llu S%d %-14s %-30s(0x%x) ", |
| 59 | index, record->time, record->session, "HDD Event:", |
| 60 | hdd_trace_event_string(record->code), record->data); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 61 | } |
| 62 | |
| 63 | /** |
| 64 | * hdd_trace_init() - HDD trace subsystem initialization |
| 65 | * |
| 66 | * Registers HDD with the debug trace subsystem |
| 67 | * |
| 68 | * Return: none |
| 69 | */ |
| 70 | void hdd_trace_init(void) |
| 71 | { |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame^] | 72 | cdf_trace_register(QDF_MODULE_ID_HDD, hdd_trace_dump); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 73 | } |
| 74 | |
| 75 | #endif /* ifdef HDD_TRACE_RECORD */ |