18c2ecf20Sopenharmony_ci/* 28c2ecf20Sopenharmony_ci * Copyright (c) 2014 Qualcomm Atheros, Inc. 38c2ecf20Sopenharmony_ci * 48c2ecf20Sopenharmony_ci * Permission to use, copy, modify, and/or distribute this software for any 58c2ecf20Sopenharmony_ci * purpose with or without fee is hereby granted, provided that the above 68c2ecf20Sopenharmony_ci * copyright notice and this permission notice appear in all copies. 78c2ecf20Sopenharmony_ci * 88c2ecf20Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 98c2ecf20Sopenharmony_ci * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 108c2ecf20Sopenharmony_ci * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 118c2ecf20Sopenharmony_ci * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 128c2ecf20Sopenharmony_ci * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 138c2ecf20Sopenharmony_ci * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 148c2ecf20Sopenharmony_ci * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 158c2ecf20Sopenharmony_ci */ 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ci#if !defined(_TRACE_H) || defined(TRACE_HEADER_MULTI_READ) 188c2ecf20Sopenharmony_ci#define _TRACE_H 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci#include <linux/tracepoint.h> 218c2ecf20Sopenharmony_ci#include "ath.h" 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_ci#undef TRACE_SYSTEM 248c2ecf20Sopenharmony_ci#define TRACE_SYSTEM ath 258c2ecf20Sopenharmony_ci 268c2ecf20Sopenharmony_ci#if !defined(CONFIG_ATH_TRACEPOINTS) 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_ci#undef TRACE_EVENT 298c2ecf20Sopenharmony_ci#define TRACE_EVENT(name, proto, ...) static inline void trace_ ## name(proto) {} 308c2ecf20Sopenharmony_ci 318c2ecf20Sopenharmony_ci#endif /* CONFIG_ATH_TRACEPOINTS */ 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ciTRACE_EVENT(ath_log, 348c2ecf20Sopenharmony_ci 358c2ecf20Sopenharmony_ci TP_PROTO(struct wiphy *wiphy, 368c2ecf20Sopenharmony_ci struct va_format *vaf), 378c2ecf20Sopenharmony_ci 388c2ecf20Sopenharmony_ci TP_ARGS(wiphy, vaf), 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_ci TP_STRUCT__entry( 418c2ecf20Sopenharmony_ci __string(device, wiphy_name(wiphy)) 428c2ecf20Sopenharmony_ci __string(driver, KBUILD_MODNAME) 438c2ecf20Sopenharmony_ci __dynamic_array(char, msg, ATH_DBG_MAX_LEN) 448c2ecf20Sopenharmony_ci ), 458c2ecf20Sopenharmony_ci 468c2ecf20Sopenharmony_ci TP_fast_assign( 478c2ecf20Sopenharmony_ci __assign_str(device, wiphy_name(wiphy)); 488c2ecf20Sopenharmony_ci __assign_str(driver, KBUILD_MODNAME); 498c2ecf20Sopenharmony_ci WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg), 508c2ecf20Sopenharmony_ci ATH_DBG_MAX_LEN, 518c2ecf20Sopenharmony_ci vaf->fmt, 528c2ecf20Sopenharmony_ci *vaf->va) >= ATH_DBG_MAX_LEN); 538c2ecf20Sopenharmony_ci ), 548c2ecf20Sopenharmony_ci 558c2ecf20Sopenharmony_ci TP_printk( 568c2ecf20Sopenharmony_ci "%s %s %s", 578c2ecf20Sopenharmony_ci __get_str(driver), 588c2ecf20Sopenharmony_ci __get_str(device), 598c2ecf20Sopenharmony_ci __get_str(msg) 608c2ecf20Sopenharmony_ci ) 618c2ecf20Sopenharmony_ci); 628c2ecf20Sopenharmony_ci 638c2ecf20Sopenharmony_ci#endif /* _TRACE_H || TRACE_HEADER_MULTI_READ */ 648c2ecf20Sopenharmony_ci 658c2ecf20Sopenharmony_ci#undef TRACE_INCLUDE_PATH 668c2ecf20Sopenharmony_ci#define TRACE_INCLUDE_PATH . 678c2ecf20Sopenharmony_ci#undef TRACE_INCLUDE_FILE 688c2ecf20Sopenharmony_ci#define TRACE_INCLUDE_FILE trace 698c2ecf20Sopenharmony_ci 708c2ecf20Sopenharmony_ci/* This part must be outside protection */ 718c2ecf20Sopenharmony_ci#include <trace/define_trace.h> 72