Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b2ec360e authored by Ashish Kumar Dhanotiya's avatar Ashish Kumar Dhanotiya Committed by snandini
Browse files

qcacmn: Add driver command to dump function call mapping

Add driver command support to dump all the function call mapping
which is cached in global buffer.

Change-Id: I6df9273c641e2cf3ecefe64c8f3c15d8ec2f9b20
CRs-Fixed: 2677981
parent 982fbab9
Loading
Loading
Loading
Loading
+46 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2020 The Linux Foundation. All rights reserved.
 *
 * Permission to use, copy, modify, and/or distribute this software for
 * any purpose with or without fee is hereby granted, provided that the
 * above copyright notice and this permission notice appear in all
 * copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 * PERFORMANCE OF THIS SOFTWARE.
 */

#include <linux/string.h>
#include <qdf_func_tracker.h>
#include <qdf_mem.h>

#ifdef FUNC_CALL_MAP
char qdf_func_call_map_buf[QDF_FUNCTION_CALL_MAP_BUF_LEN] = {0};

void cc_func(unsigned int track)
{
	unsigned int index = 0;
	unsigned int bit = 0;

	index = track / 8;
	bit = track % 8;
	qdf_func_call_map_buf[index] |= (char)(1 << bit);
}

void qdf_get_func_call_map(char *data)
{
	qdf_mem_copy(data, qdf_func_call_map_buf,
		     QDF_FUNCTION_CALL_MAP_BUF_LEN);
}

void qdf_clear_func_call_map(void)
{
	qdf_mem_zero(qdf_func_call_map_buf, QDF_FUNCTION_CALL_MAP_BUF_LEN);
}
#endif
+67 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2020 The Linux Foundation. All rights reserved.
 *
 * Permission to use, copy, modify, and/or distribute this software for
 * any purpose with or without fee is hereby granted, provided that the
 * above copyright notice and this permission notice appear in all
 * copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 * PERFORMANCE OF THIS SOFTWARE.
 */

#ifndef QDF_FUNC_TRACKER_H
#define QDF_FUNC_TRACKER_H

#ifdef FUNC_CALL_MAP

#define QDF_FUNCTION_CALL_MAP_BUF_LEN 4096

/**
 * cc_func() - Inserts the function Id into the global
 * function map
 * @track: Function Id which needs to be inserted into the
 * Global function map.
 *
 * Return: None
 */
void cc_func(unsigned int track);

/**
 * qdf_get_func_call_map() - Copies the global function call
 * map into the given buffer
 * @data: Buffer in which the function call map needs to be
 * copied
 *
 * Return: None
 */
void qdf_get_func_call_map(char *data);

/**
 * qdf_clear_func_call_map() - Clears the global function
 * call map
 *
 * Return: None
 */
void qdf_clear_func_call_map(void);
#else
static inline void cc_func(unsigned int track)
{
}

static inline void qdf_get_func_call_map(char *data)
{
}

static inline void qdf_clear_func_call_map(void)
{
}

#endif
#endif