diff options
author | Karol Trzcinski <karolx.trzcinski@linux.intel.com> | 2020-11-24 19:00:17 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-11-25 12:07:17 +0100 |
commit | 5b10b62989219aa527ee4fa555d1995a3b70981b (patch) | |
tree | 0004288fcf953f01a1d20617770391c87654e746 /sound/soc/sof/loader.c | |
parent | ASoC: SOF: Change section comment for SOF_IPC_TEST_ (diff) | |
download | linux-5b10b62989219aa527ee4fa555d1995a3b70981b.tar.xz linux-5b10b62989219aa527ee4fa555d1995a3b70981b.zip |
ASoC: SOF: Add `memory_info` file to debugfs
This file content describes memory allocation status
at run-time, typically to detect memory leaks.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20201124180017.2232128-5-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/loader.c')
-rw-r--r-- | sound/soc/sof/loader.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sound/soc/sof/loader.c b/sound/soc/sof/loader.c index 33d3be774380..2a8c9bff9963 100644 --- a/sound/soc/sof/loader.c +++ b/sound/soc/sof/loader.c @@ -205,6 +205,7 @@ static int ext_man_get_config_data(struct snd_sof_dev *sdev, const struct sof_config_elem *elem; int elems_counter; int elems_size; + int ret = 0; int i; /* calculate elements counter */ @@ -225,11 +226,20 @@ static int ext_man_get_config_data(struct snd_sof_dev *sdev, case SOF_EXT_MAN_CONFIG_IPC_MSG_SIZE: /* TODO: use ipc msg size from config data */ break; + case SOF_EXT_MAN_CONFIG_MEMORY_USAGE_SCAN: + if (sdev->first_boot && elem->value) + ret = snd_sof_dbg_memory_info_init(sdev); + break; default: dev_info(sdev->dev, "Unknown firmware configuration token %d value %d", elem->token, elem->value); break; } + if (ret < 0) { + dev_err(sdev->dev, "error: processing sof_ext_man_config_data failed for token %d value 0x%x, %d\n", + elem->token, elem->value, ret); + return ret; + } } return 0; |