From 72cea1a23cae628c0e84d5ec7fa285155f48fbf7 Mon Sep 17 00:00:00 2001 From: Xiaojun Sang Date: Mon, 21 Jan 2019 14:31:03 +0800 Subject: [PATCH] codecs: reduce error log rate Huge volume of log prints out at error. Reduce the redundant log. Change-Id: I761d5953614d039b7a725926c38adee1beeeec41 Signed-off-by: Xiaojun Sang --- dsp/codecs/audio_aac.c | 14 ++++++++++++-- dsp/codecs/audio_alac.c | 15 ++++++++++++--- dsp/codecs/audio_amrnb.c | 16 +++++++++++++--- dsp/codecs/audio_amrwbplus.c | 14 ++++++++++++-- dsp/codecs/audio_ape.c | 14 ++++++++++++-- dsp/codecs/audio_evrc.c | 14 ++++++++++++-- dsp/codecs/audio_g711alaw.c | 14 ++++++++++++-- dsp/codecs/audio_g711mlaw.c | 14 ++++++++++++-- dsp/codecs/audio_mp3.c | 14 ++++++++++++-- dsp/codecs/audio_multi_aac.c | 14 ++++++++++++-- dsp/codecs/audio_qcelp.c | 14 ++++++++++++-- dsp/codecs/audio_utils_aio.c | 16 +++++++++++++--- dsp/codecs/audio_wma.c | 14 ++++++++++++-- dsp/codecs/audio_wmapro.c | 14 ++++++++++++-- 14 files changed, 170 insertions(+), 31 deletions(-) diff --git a/dsp/codecs/audio_aac.c b/dsp/codecs/audio_aac.c index cf3d448470..32106e5854 100644 --- a/dsp/codecs/audio_aac.c +++ b/dsp/codecs/audio_aac.c @@ -3,7 +3,17 @@ * * Copyright (C) 2008 Google, Inc. * Copyright (C) 2008 HTC Corporation - * Copyright (c) 2010-2018, The Linux Foundation. All rights reserved. + * Copyright (c) 2010-2019, The Linux Foundation. All rights reserved. + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * */ #include @@ -383,7 +393,7 @@ static int audio_open(struct inode *inode, struct file *file) } rc = audio_aio_open(audio, file); if (rc < 0) { - pr_err("%s: audio_aio_open rc=%d\n", + pr_err_ratelimited("%s: audio_aio_open rc=%d\n", __func__, rc); goto fail; } diff --git a/dsp/codecs/audio_alac.c b/dsp/codecs/audio_alac.c index ea05d7100a..f7e09323dd 100644 --- a/dsp/codecs/audio_alac.c +++ b/dsp/codecs/audio_alac.c @@ -1,6 +1,15 @@ // SPDX-License-Identifier: GPL-2.0-only -/* - * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. +/* Copyright (c) 2015-2019, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * */ #include @@ -290,7 +299,7 @@ static int audio_open(struct inode *inode, struct file *file) } rc = audio_aio_open(audio, file); if (rc < 0) { - pr_err("%s: audio_aio_open rc=%d\n", + pr_err_ratelimited("%s: audio_aio_open rc=%d\n", __func__, rc); goto fail; } diff --git a/dsp/codecs/audio_amrnb.c b/dsp/codecs/audio_amrnb.c index efec4d2d33..ea6d02fcfb 100644 --- a/dsp/codecs/audio_amrnb.c +++ b/dsp/codecs/audio_amrnb.c @@ -3,7 +3,17 @@ * * Copyright (C) 2008 Google, Inc. * Copyright (C) 2008 HTC Corporation - * Copyright (c) 2011-2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2017, 2019 The Linux Foundation. All rights reserved. + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * */ #include @@ -137,7 +147,7 @@ static int audio_open(struct inode *inode, struct file *file) } rc = audio_aio_open(audio, file); if (rc < 0) { - pr_err("%s: audio_aio_open rc=%d\n", + pr_err_ratelimited("%s: audio_aio_open rc=%d\n", __func__, rc); goto fail; } @@ -178,7 +188,7 @@ static int audio_open(struct inode *inode, struct file *file) if (IS_ERR(audio->dentry)) pr_debug("debugfs_create_file failed\n"); #endif - pr_info("%s:amrnb decoder open success, session_id = %d\n", __func__, + pr_info_ratelimited("%s:amrnb decoder open success, session_id = %d\n", __func__, audio->ac->session); return rc; fail: diff --git a/dsp/codecs/audio_amrwbplus.c b/dsp/codecs/audio_amrwbplus.c index d06b054b37..6cadab722a 100644 --- a/dsp/codecs/audio_amrwbplus.c +++ b/dsp/codecs/audio_amrwbplus.c @@ -3,7 +3,17 @@ * * Copyright (C) 2008 Google, Inc. * Copyright (C) 2008 HTC Corporation - * Copyright (c) 2010-2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2010-2017, 2019 The Linux Foundation. All rights reserved. + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * */ #include #include @@ -313,7 +323,7 @@ static int audio_open(struct inode *inode, struct file *file) } rc = audio_aio_open(audio, file); if (rc < 0) { - pr_err("%s: audio_aio_open rc=%d\n", + pr_err_ratelimited("%s: audio_aio_open rc=%d\n", __func__, rc); goto fail; } diff --git a/dsp/codecs/audio_ape.c b/dsp/codecs/audio_ape.c index 219df404e5..1e12981524 100644 --- a/dsp/codecs/audio_ape.c +++ b/dsp/codecs/audio_ape.c @@ -1,5 +1,15 @@ // SPDX-License-Identifier: GPL-2.0-only -/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. +/* Copyright (c) 2015-2019, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * */ #include @@ -271,7 +281,7 @@ static int audio_open(struct inode *inode, struct file *file) } rc = audio_aio_open(audio, file); if (rc < 0) { - pr_err("%s: audio_aio_open rc=%d\n", + pr_err_ratelimited("%s: audio_aio_open rc=%d\n", __func__, rc); goto fail; } diff --git a/dsp/codecs/audio_evrc.c b/dsp/codecs/audio_evrc.c index c3bf9b8bed..48d26525b0 100644 --- a/dsp/codecs/audio_evrc.c +++ b/dsp/codecs/audio_evrc.c @@ -3,7 +3,17 @@ * * Copyright (C) 2008 Google, Inc. * Copyright (C) 2008 HTC Corporation - * Copyright (c) 2011-2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2017, 2019 The Linux Foundation. All rights reserved. + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * */ #include "audio_utils_aio.h" @@ -94,7 +104,7 @@ static int audio_open(struct inode *inode, struct file *file) } rc = audio_aio_open(audio, file); if (rc < 0) { - pr_err("%s: audio_aio_open rc=%d\n", + pr_err_ratelimited("%s: audio_aio_open rc=%d\n", __func__, rc); goto fail; } diff --git a/dsp/codecs/audio_g711alaw.c b/dsp/codecs/audio_g711alaw.c index 3dac27d50d..b4a1d7ee5c 100644 --- a/dsp/codecs/audio_g711alaw.c +++ b/dsp/codecs/audio_g711alaw.c @@ -1,5 +1,15 @@ // SPDX-License-Identifier: GPL-2.0-only -/* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2016-2017, 2019 The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * */ #include @@ -245,7 +255,7 @@ static int audio_open(struct inode *inode, struct file *file) } rc = audio_aio_open(audio, file); if (rc < 0) { - pr_err("%s: audio_aio_open rc=%d\n", + pr_err_ratelimited("%s: audio_aio_open rc=%d\n", __func__, rc); goto fail; } diff --git a/dsp/codecs/audio_g711mlaw.c b/dsp/codecs/audio_g711mlaw.c index c0102d0d64..1cf8a97870 100644 --- a/dsp/codecs/audio_g711mlaw.c +++ b/dsp/codecs/audio_g711mlaw.c @@ -1,5 +1,15 @@ // SPDX-License-Identifier: GPL-2.0-only -/* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2016-2017, 2019 The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * */ #include @@ -244,7 +254,7 @@ static int audio_open(struct inode *inode, struct file *file) } rc = audio_aio_open(audio, file); if (rc < 0) { - pr_err("%s: audio_aio_open rc=%d\n", + pr_err_ratelimited("%s: audio_aio_open rc=%d\n", __func__, rc); goto fail; } diff --git a/dsp/codecs/audio_mp3.c b/dsp/codecs/audio_mp3.c index 47446d3cc8..7228cba3a4 100644 --- a/dsp/codecs/audio_mp3.c +++ b/dsp/codecs/audio_mp3.c @@ -3,7 +3,17 @@ * * Copyright (C) 2008 Google, Inc. * Copyright (C) 2008 HTC Corporation - * Copyright (c) 2011-2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2017, 2019 The Linux Foundation. All rights reserved. + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * */ #include "audio_utils_aio.h" @@ -96,7 +106,7 @@ static int audio_open(struct inode *inode, struct file *file) } rc = audio_aio_open(audio, file); if (rc < 0) { - pr_err("%s: audio_aio_open rc=%d\n", + pr_err_ratelimited("%s: audio_aio_open rc=%d\n", __func__, rc); goto fail; } diff --git a/dsp/codecs/audio_multi_aac.c b/dsp/codecs/audio_multi_aac.c index fc3f492485..2c88ebf476 100644 --- a/dsp/codecs/audio_multi_aac.c +++ b/dsp/codecs/audio_multi_aac.c @@ -3,7 +3,17 @@ * * Copyright (C) 2008 Google, Inc. * Copyright (C) 2008 HTC Corporation - * Copyright (c) 2011-2018, The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2019, The Linux Foundation. All rights reserved. + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * */ #include @@ -437,7 +447,7 @@ static int audio_open(struct inode *inode, struct file *file) } rc = audio_aio_open(audio, file); if (rc < 0) { - pr_err("%s: audio_aio_open rc=%d\n", + pr_err_ratelimited("%s: audio_aio_open rc=%d\n", __func__, rc); goto fail; } diff --git a/dsp/codecs/audio_qcelp.c b/dsp/codecs/audio_qcelp.c index fcf39f56b0..7e88cfd1b4 100644 --- a/dsp/codecs/audio_qcelp.c +++ b/dsp/codecs/audio_qcelp.c @@ -3,7 +3,17 @@ * * Copyright (C) 2008 Google, Inc. * Copyright (C) 2008 HTC Corporation - * Copyright (c) 2011-2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2017, 2019 The Linux Foundation. All rights reserved. + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * */ #include "audio_utils_aio.h" @@ -101,7 +111,7 @@ static int audio_open(struct inode *inode, struct file *file) } rc = audio_aio_open(audio, file); if (rc < 0) { - pr_err("%s: audio_aio_open rc=%d\n", + pr_err_ratelimited("%s: audio_aio_open rc=%d\n", __func__, rc); goto fail; } diff --git a/dsp/codecs/audio_utils_aio.c b/dsp/codecs/audio_utils_aio.c index eabf170a8c..f22163567a 100644 --- a/dsp/codecs/audio_utils_aio.c +++ b/dsp/codecs/audio_utils_aio.c @@ -1,7 +1,17 @@ // SPDX-License-Identifier: GPL-2.0-only /* Copyright (C) 2008 Google, Inc. * Copyright (C) 2008 HTC Corporation - * Copyright (c) 2009-2018, The Linux Foundation. All rights reserved. + * Copyright (c) 2009-2019, The Linux Foundation. All rights reserved. + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * */ #include @@ -1335,7 +1345,7 @@ int audio_aio_open(struct q6audio_aio *audio, struct file *file) audio->drv_ops.in_flush = audio_aio_async_in_flush; q6asm_set_io_mode(audio->ac, ASYNC_IO_MODE); } else { - pr_err("%s[%pK]:SIO interface not supported\n", + pr_err_ratelimited("%s[%pK]:SIO interface not supported\n", __func__, audio); rc = -EACCES; goto fail; @@ -1548,7 +1558,7 @@ static long audio_aio_shared_ioctl(struct file *file, unsigned int cmd, break; } default: - pr_err("%s: Unknown ioctl cmd = %d", __func__, cmd); + pr_err_ratelimited("%s: Unknown ioctl cmd = %d", __func__, cmd); rc = -EINVAL; } return rc; diff --git a/dsp/codecs/audio_wma.c b/dsp/codecs/audio_wma.c index cdd23ff57b..66c818d5cb 100644 --- a/dsp/codecs/audio_wma.c +++ b/dsp/codecs/audio_wma.c @@ -3,7 +3,17 @@ * * Copyright (C) 2008 Google, Inc. * Copyright (C) 2008 HTC Corporation - * Copyright (c) 2009-2018, The Linux Foundation. All rights reserved. + * Copyright (c) 2009-2019, The Linux Foundation. All rights reserved. + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * */ #include @@ -253,7 +263,7 @@ static int audio_open(struct inode *inode, struct file *file) } rc = audio_aio_open(audio, file); if (rc < 0) { - pr_err("%s: audio_aio_open rc=%d\n", + pr_err_ratelimited("%s: audio_aio_open rc=%d\n", __func__, rc); goto fail; } diff --git a/dsp/codecs/audio_wmapro.c b/dsp/codecs/audio_wmapro.c index c0a27576b4..4fc3312395 100644 --- a/dsp/codecs/audio_wmapro.c +++ b/dsp/codecs/audio_wmapro.c @@ -3,7 +3,17 @@ * * Copyright (C) 2008 Google, Inc. * Copyright (C) 2008 HTC Corporation - * Copyright (c) 2009-2018, The Linux Foundation. All rights reserved. + * Copyright (c) 2009-2019, The Linux Foundation. All rights reserved. + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * */ #include @@ -327,7 +337,7 @@ static int audio_open(struct inode *inode, struct file *file) rc = audio_aio_open(audio, file); if (rc < 0) { - pr_err("%s: audio_aio_open rc=%d\n", + pr_err_ratelimited("%s: audio_aio_open rc=%d\n", __func__, rc); goto fail; }