Skip to content

Commit

Permalink
Merge branch 'bugfix/increase_pm_dump_time_field_length_v5.1' into 'r…
Browse files Browse the repository at this point in the history
…elease/v5.1'

Power Management: increase pm_dump time field width (backport v5.1)

See merge request espressif/esp-idf!24450
  • Loading branch information
jack0c committed Jul 4, 2023
2 parents b0717c6 + 171544d commit 29f52ac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
24 changes: 8 additions & 16 deletions components/esp_pm/pm_locks.c
@@ -1,16 +1,8 @@
// Copyright 2016-2017 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
* SPDX-FileCopyrightText: 2016-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <stdlib.h>
#include <string.h>
Expand Down Expand Up @@ -173,13 +165,13 @@ esp_err_t esp_pm_dump_locks(FILE* stream)

fprintf(stream, "Lock stats:\n");
#ifdef WITH_PROFILING
fprintf(stream, "%-15s %-14s %-5s %-8s %-13s %-8s %-8s\n",
fprintf(stream, "%-15s %-14s %-5s %-8s %-13s %-14s %-8s\n",
"Name", "Type", "Arg", "Active", "Total_count", "Time(us)", "Time(%)");
#else
fprintf(stream, "%-15s %-14s %-5s %-8s\n", "Name", "Type", "Arg", "Active");
#endif
esp_pm_lock_t* it;
char line[80];
char line[128];
SLIST_FOREACH(it, &s_list, next) {
char *buf = line;
size_t len = sizeof(line);
Expand All @@ -199,7 +191,7 @@ esp_err_t esp_pm_dump_locks(FILE* stream)
if (it->count > 0) {
time_held += cur_time - it->last_taken;
}
snprintf(buf, len, "%-14s %-5d %-8d %-13d %-8lld %-3lld%%\n",
snprintf(buf, len, "%-14s %-5d %-8d %-13d %-14lld %-3lld%%\n",
s_lock_type_names[it->type], it->arg,
it->count, it->times_taken, time_held,
(time_held + cur_time_d100 - 1) / cur_time_d100);
Expand Down
1 change: 0 additions & 1 deletion tools/ci/check_copyright_ignore.txt
Expand Up @@ -438,7 +438,6 @@ components/esp_netif/test_apps/component_ut_test.py
components/esp_netif/test_apps/main/esp_netif_test.c
components/esp_phy/test/test_phy_rtc.c
components/esp_pm/include/esp_private/pm_trace.h
components/esp_pm/pm_locks.c
components/esp_pm/test/test_pm.c
components/esp_rom/esp32/ld/esp32.rom.api.ld
components/esp_rom/esp32/ld/esp32.rom.eco3.ld
Expand Down

0 comments on commit 29f52ac

Please sign in to comment.