intel / thermal_daemon

Thermal daemon for IA
GNU General Public License v2.0
540 stars 117 forks source link

lots of seemingly redundant spaces before carriage retrurn on logged messages #457

Closed ColinIanKing closed 3 weeks ago

ColinIanKing commented 1 month ago

I noticed that a lot of logged messages have a space before the carriage return \n character. Is this intentional? It just seems to add more redundant spaces in the log file.

git grep -F " \n"       
src/android_main.cpp:           thd_log_warn("Received SIGHUP signal. \n");
src/android_main.cpp:           thd_log_info("Daemon exiting \n");
src/android_main.cpp:                   "  --config-file Configuration file to use other than the default config. \n");
src/android_main.cpp:   thd_log_info("Linux Thermal Daemon is exiting \n");
src/thd_cdev.cpp:                               thd_log_info("forced to min_state \n");
src/thd_cdev.cpp:                               thd_log_info("forced to min_state \n");
src/thd_cdev.h:                 thd_log_info("%d: %s, C:%d MN: %d MX:%d Inc ST:%d Dec ST:%d pt:%s rd_bk %d \n", index,
src/thd_cdev.h:                 thd_log_info("%d: %s, C:%d MN: %d MX:%d ST:%d pt:%s rd_bk %d \n", index,
src/thd_cdev_intel_pstate_driver.cpp:           thd_log_info("turbo disabled \n");
src/thd_cdev_intel_pstate_driver.cpp:           thd_log_info("turbo enabled \n");
src/thd_cdev_kbl_amdgpu.cpp:            thd_log_info("ignore \n");
src/thd_cdev_order_parser.cpp:          thd_log_warn("error: could not get root element \n");
src/thd_cdev_rapl.cpp:          thd_log_debug("powercap RAPL no  power limit uw %s \n",
src/thd_cdev_rapl.cpp:          thd_log_info("powercap RAPL no time_window_us %s \n",
src/thd_cdev_rapl.cpp:                          "pkg_power: powercap RAPL max power limit failed to write %d \n",
src/thd_cdev_rapl.cpp:                          "pkg_power: powercap RAPL max power limit failed to write PL2 %d \n",
src/thd_cdev_rapl.cpp:                          "pkg_power: powercap RAPL time window failed to write %d \n",
src/thd_cdev_rapl.cpp:                          "pkg_power: powercap RAPL time window failed to write %d \n",
src/thd_cdev_rapl.cpp:                          "pkg_power: powercap RAPL enable failed to write %d \n",
src/thd_cdev_rapl.cpp:                          thd_log_info("%s:powercap RAPL invalid max power limit range \n",
src/thd_cdev_rapl.cpp:                  thd_log_info("Calculate dynamically phy_max \n");
src/thd_cdev_rapl.cpp:          thd_log_info("powercap RAPL max power limit range %d \n", phy_max);
src/thd_cpu_default_binding.cpp:                        thd_log_info("Turn on the gate \n");
src/thd_cpu_default_binding.cpp:                        thd_log_info("Not CPU specific increase \n");
src/thd_cpu_default_binding.cpp:                thd_log_info("Significant cpu load \n");
src/thd_cpu_default_binding.cpp:                                thd_log_info("do_default_binding failed \n");
src/thd_cpu_default_binding.cpp:                                thd_log_info("do_default_binding failed \n");
src/thd_engine.cpp:                     thd_log_warn("Write to pipe failed \n");
src/thd_engine.cpp:                             thd_log_msg("Thermal Daemon is disabled \n");
src/thd_engine.cpp:             thd_log_debug("Ignore CPU ID check for MSRs \n");
src/thd_engine.cpp:                             thd_log_msg("Unsupported cpu model, using thermal-conf.xml only \n");
src/thd_engine.cpp:                             thd_log_msg("Unsupported cpu model, use thermal-conf.xml file or run with --ignore-cpuid-check \n");
src/thd_engine.cpp:             thd_log_warn("Write to pipe failed \n");
src/thd_engine.cpp:             thd_log_msg("Preference changed \n");
src/thd_engine.cpp:             thd_log_debug("thd_engine polling enabled via %u \n", *sensor_id);
src/thd_engine.cpp:                     thd_log_debug("thd_engine polling last disabled via %u \n",
src/thd_engine.cpp:             thd_log_debug("thd_engine fast polling enabled via %u \n", *sensor_id);
src/thd_engine.cpp:                     thd_log_debug("thd_engine polling last disabled via %u \n",
src/thd_engine.cpp:                     thd_log_msg("Thermal Daemon is disabled \n");
src/thd_engine.cpp:     thd_log_info("Taking over thermal control \n");
src/thd_engine.cpp:     thd_log_info("Giving up thermal control \n");
src/thd_engine.cpp:             thd_log_msg(" Need Linux PowerCap sysfs \n");
src/thd_engine.cpp:     thd_log_debug("thd_read_default_thermal_sensors \n");
src/thd_engine.cpp:     thd_log_info("thd_read_default_thermal_sensors loaded %zu sensors \n",
src/thd_engine.cpp:     thd_log_debug("thd_read_default_thermal_zones \n");
src/thd_engine.cpp:     thd_log_info("thd_read_default_thermal_zones loaded %zu zones \n",
src/thd_engine.cpp:     thd_log_debug("thd_read_default_cooling devices \n");
src/thd_engine.cpp:     thd_log_info("thd_read_default_cooling devices loaded %zu cdevs \n",
src/thd_engine_default.cpp:                             thd_log_info("Processor thermal device is present \n");
src/thd_engine_default.cpp:                             thd_log_info("It will act as CPU thermal zone !! \n");
src/thd_engine_default.cpp:             thd_log_info("zone cpu will be created \n");
src/thd_engine_default.cpp:                     thd_log_debug("Look for Zone  [%s] \n", zone_config->type.c_str());
src/thd_engine_default.cpp:                             thd_log_info("Zone already present %s \n",
src/thd_engine_default.cpp:                                             thd_log_debug("Trip temp == 0 is in zone %s \n",
src/thd_engine_default.cpp:             thd_log_info("No Thermal Zones found \n");
src/thd_gddv.cpp:       thd_log_info("..apat dump begin.. \n");
src/thd_gddv.cpp:       thd_log_info("..apct dump begin.. \n");
src/thd_gddv.cpp:                                                       " stare:%d state_entry_time:%d \n",
src/thd_gddv.cpp:       thd_log_info("..apct dump end.. \n");
src/thd_gddv.cpp:       thd_log_info("..ppcc dump begin.. \n");
src/thd_gddv.cpp:       thd_log_info("..psvt dump begin.. \n");
src/thd_gddv.cpp:       thd_log_info("..itmt dump begin.. \n");
src/thd_gddv.cpp:       thd_log_info("..idsp dump begin.. \n");
src/thd_gddv.cpp:       thd_log_info("..trippoint dump begin.. \n");
src/thd_kobj_uevent.cpp:                thd_log_warn("kob_uevent bin failed \n");
src/thd_parse.cpp:                      thd_log_msg("Using generated %s \n", filename_auto_conf.c_str());
src/thd_parse.cpp:              thd_log_warn("error: could not get root element \n");
src/thd_parse.cpp:                      thd_log_info("\tSensor %u \n", j);
src/thd_parse.cpp:                      thd_log_info("\tZone %u \n", j);
src/thd_parse.cpp:                              thd_log_info("\t\t Trip Point %u \n", k);
src/thd_parse.cpp:                              thd_log_info("\t\t  temp/power %d \n",
(sid-chroot)cking@t480:~/repos/thermal_daemon$ git grep -F " \n"  
src/android_main.cpp:           thd_log_warn("Received SIGHUP signal. \n");
src/android_main.cpp:           thd_log_info("Daemon exiting \n");
src/android_main.cpp:                   "  --config-file Configuration file to use other than the default config. \n");
src/android_main.cpp:   thd_log_info("Linux Thermal Daemon is exiting \n");
src/thd_cdev.cpp:                               thd_log_info("forced to min_state \n");
src/thd_cdev.cpp:                               thd_log_info("forced to min_state \n");
src/thd_cdev.h:                 thd_log_info("%d: %s, C:%d MN: %d MX:%d Inc ST:%d Dec ST:%d pt:%s rd_bk %d \n", index,
src/thd_cdev.h:                 thd_log_info("%d: %s, C:%d MN: %d MX:%d ST:%d pt:%s rd_bk %d \n", index,
src/thd_cdev_intel_pstate_driver.cpp:           thd_log_info("turbo disabled \n");
src/thd_cdev_intel_pstate_driver.cpp:           thd_log_info("turbo enabled \n");
src/thd_cdev_kbl_amdgpu.cpp:            thd_log_info("ignore \n");
src/thd_cdev_order_parser.cpp:          thd_log_warn("error: could not get root element \n");
src/thd_cdev_rapl.cpp:          thd_log_debug("powercap RAPL no  power limit uw %s \n",
src/thd_cdev_rapl.cpp:          thd_log_info("powercap RAPL no time_window_us %s \n",
src/thd_cdev_rapl.cpp:                          "pkg_power: powercap RAPL max power limit failed to write %d \n",
src/thd_cdev_rapl.cpp:                          "pkg_power: powercap RAPL max power limit failed to write PL2 %d \n",
src/thd_cdev_rapl.cpp:                          "pkg_power: powercap RAPL time window failed to write %d \n",
src/thd_cdev_rapl.cpp:                          "pkg_power: powercap RAPL time window failed to write %d \n",
src/thd_cdev_rapl.cpp:                          "pkg_power: powercap RAPL enable failed to write %d \n",
src/thd_cdev_rapl.cpp:                          thd_log_info("%s:powercap RAPL invalid max power limit range \n",
src/thd_cdev_rapl.cpp:                  thd_log_info("Calculate dynamically phy_max \n");
src/thd_cdev_rapl.cpp:          thd_log_info("powercap RAPL max power limit range %d \n", phy_max);
src/thd_cpu_default_binding.cpp:                        thd_log_info("Turn on the gate \n");
src/thd_cpu_default_binding.cpp:                        thd_log_info("Not CPU specific increase \n");
src/thd_cpu_default_binding.cpp:                thd_log_info("Significant cpu load \n");
src/thd_cpu_default_binding.cpp:                                thd_log_info("do_default_binding failed \n");
src/thd_cpu_default_binding.cpp:                                thd_log_info("do_default_binding failed \n");
src/thd_engine.cpp:                     thd_log_warn("Write to pipe failed \n");
src/thd_engine.cpp:                             thd_log_msg("Thermal Daemon is disabled \n");
src/thd_engine.cpp:             thd_log_debug("Ignore CPU ID check for MSRs \n");
src/thd_engine.cpp:                             thd_log_msg("Unsupported cpu model, using thermal-conf.xml only \n");
src/thd_engine.cpp:                             thd_log_msg("Unsupported cpu model, use thermal-conf.xml file or run with --ignore-cpuid-check \n");
src/thd_engine.cpp:             thd_log_warn("Write to pipe failed \n");
src/thd_engine.cpp:             thd_log_msg("Preference changed \n");
src/thd_engine.cpp:             thd_log_debug("thd_engine polling enabled via %u \n", *sensor_id);
src/thd_engine.cpp:                     thd_log_debug("thd_engine polling last disabled via %u \n",
src/thd_engine.cpp:             thd_log_debug("thd_engine fast polling enabled via %u \n", *sensor_id);
src/thd_engine.cpp:                     thd_log_debug("thd_engine polling last disabled via %u \n",
src/thd_engine.cpp:                     thd_log_msg("Thermal Daemon is disabled \n");
src/thd_engine.cpp:     thd_log_info("Taking over thermal control \n");
src/thd_engine.cpp:     thd_log_info("Giving up thermal control \n");
src/thd_engine.cpp:             thd_log_msg(" Need Linux PowerCap sysfs \n");
src/thd_engine.cpp:     thd_log_debug("thd_read_default_thermal_sensors \n");
src/thd_engine.cpp:     thd_log_info("thd_read_default_thermal_sensors loaded %zu sensors \n",
src/thd_engine.cpp:     thd_log_debug("thd_read_default_thermal_zones \n");
src/thd_engine.cpp:     thd_log_info("thd_read_default_thermal_zones loaded %zu zones \n",
src/thd_engine.cpp:     thd_log_debug("thd_read_default_cooling devices \n");
src/thd_engine.cpp:     thd_log_info("thd_read_default_cooling devices loaded %zu cdevs \n",
src/thd_engine_default.cpp:                             thd_log_info("Processor thermal device is present \n");
src/thd_engine_default.cpp:                             thd_log_info("It will act as CPU thermal zone !! \n");
src/thd_engine_default.cpp:             thd_log_info("zone cpu will be created \n");
src/thd_engine_default.cpp:                     thd_log_debug("Look for Zone  [%s] \n", zone_config->type.c_str());
src/thd_engine_default.cpp:                             thd_log_info("Zone already present %s \n",
src/thd_engine_default.cpp:                                             thd_log_debug("Trip temp == 0 is in zone %s \n",
src/thd_engine_default.cpp:             thd_log_info("No Thermal Zones found \n");
src/thd_gddv.cpp:       thd_log_info("..apat dump begin.. \n");
src/thd_gddv.cpp:       thd_log_info("..apct dump begin.. \n");
src/thd_gddv.cpp:                                                       " stare:%d state_entry_time:%d \n",
src/thd_gddv.cpp:       thd_log_info("..apct dump end.. \n");
src/thd_gddv.cpp:       thd_log_info("..ppcc dump begin.. \n");
src/thd_gddv.cpp:       thd_log_info("..psvt dump begin.. \n");
src/thd_gddv.cpp:       thd_log_info("..itmt dump begin.. \n");
src/thd_gddv.cpp:       thd_log_info("..idsp dump begin.. \n");
src/thd_gddv.cpp:       thd_log_info("..trippoint dump begin.. \n");
src/thd_kobj_uevent.cpp:                thd_log_warn("kob_uevent bin failed \n");
src/thd_parse.cpp:                      thd_log_msg("Using generated %s \n", filename_auto_conf.c_str());
src/thd_parse.cpp:              thd_log_warn("error: could not get root element \n");
src/thd_parse.cpp:                      thd_log_info("\tSensor %u \n", j);
src/thd_parse.cpp:                      thd_log_info("\tZone %u \n", j);
src/thd_parse.cpp:                              thd_log_info("\t\t Trip Point %u \n", k);
src/thd_parse.cpp:                              thd_log_info("\t\t  temp/power %d \n",
src/thd_parse.cpp:                              thd_log_info("\t\t  trip type %d \n",
src/thd_parse.cpp:                              thd_log_info("\t\t  hyst id %d \n",
src/thd_parse.cpp:                              thd_log_info("\t\t  sensor type %s \n",
src/thd_parse.cpp:                                      thd_log_info("\t\t  Dependency on %s:%s \n",
src/thd_parse.cpp:                                      thd_log_info("\t\t  cdev index %u \n", l);
src/thd_parse.cpp:                                      thd_log_info("\t\t\t  type %s \n",
src/thd_parse.cpp:                                      thd_log_info("\t\t\t  influence %d \n",
src/thd_parse.cpp:                                      thd_log_info("\t\t\t  SamplingPeriod %d \n",
src/thd_parse.cpp:                                              thd_log_info("\t\t\t  TargetState %d \n",
src/thd_parse.cpp:                                              thd_log_info("\t\t\t  PID values %f:%f:%f \n",
src/thd_parse.cpp:                      thd_log_info("\tCooling Dev %u \n", l);
src/thd_parse.cpp:                      thd_log_info("Product Sku matched \n");
src/thd_parse.cpp:                              thd_log_info("UUID matched \n");
src/thd_parse.cpp:                              thd_log_info("Product Name matched \n");
src/thd_parse.cpp:                      thd_log_info("Product Name matched \n");
src/thd_rapl_power_meter.cpp:           thd_log_debug("RAPL sysfs present \n");
src/thd_rapl_power_meter.cpp:           thd_log_warn("NO RAPL sysfs present \n");
src/thd_rapl_power_meter.cpp:                   thd_log_debug(" energy %d:%lld:%lld mj: %u mw \n",
src/thd_sensor.cpp:     thd_log_debug("Sensor %s :temp %u \n", type_str.c_str(), temp);
src/thd_sensor.h:               thd_log_info("sensor index:%d %s %s Async:%d \n", index,
src/thd_sensor_kbl_g_mcp.cpp:   thd_log_debug("Sensor %s :temp %u %u total %u \n", type_str.c_str(),
src/thd_sensor_rapl_power.cpp:  thd_log_debug("Sensor %s :power %u \n", type_str.c_str(), pkg_power);
src/thd_sensor_virtual.h:                       thd_log_info("sensor index:%d %s virtual link %s %f %f \n", index,
src/thd_trip_point.cpp:                 thd_log_info("constraint failed %s:%d:%d:%d \n",
src/thd_trip_point.cpp:                 thd_log_warn("critical temp reached \n");
src/thd_trip_point.cpp:                 thd_log_warn("Hot temp reached \n");
src/thd_trip_point.cpp:                 thd_log_warn("Hot temp reached \n");
src/thd_trip_point.cpp:                         thd_log_debug("polling trip reached, on \n");
src/thd_trip_point.cpp:                         thd_log_debug("Dropped below poll threshold \n");
src/thd_trip_point.cpp: thd_log_debug("pref %d type %d temp %d trip %d \n", pref, type, read_temp,
src/thd_trip_point.cpp:                 thd_log_debug("Active Trip point applicable \n");
src/thd_trip_point.cpp:                 thd_log_debug("Passive Trip point applicable \n");
src/thd_trip_point.cpp:                 thd_log_debug("Trip point applicable >  %d:%d \n", index, temp);
src/thd_trip_point.cpp:                 thd_log_debug("Trip point applicable <  %d:%d \n", index, temp);
src/thd_trip_point.cpp:                         thd_log_debug("Need to switch to next cdev target %d \n",
src/thd_trip_point.cpp:                         thd_log_debug("Need to switch to next cdev \n");
src/thd_trip_point.cpp: thd_log_debug("thd_trip_cdev_state_reset \n");
src/thd_trip_point.cpp:                 thd_log_debug("Need to switch to next cdev \n");
src/thd_trt_art_reader.cpp:             PRINT_ERROR("failed to open %s \n", rel_cdev.c_str ());
src/thd_trt_art_reader.cpp:             PRINT_ERROR("failed to open %s \n", rel_cdev.c_str());
src/thd_trt_art_reader.cpp:             PRINT_ERROR("failed to open %s \n", rel_cdev.c_str());
src/thd_zone.cpp:       thd_log_debug("Added zone index:%d \n", index);
src/thd_zone.cpp:               thd_log_warn("Zone update failed: unable to bind \n");
src/thd_zone.cpp:                       thd_log_debug("updating existing trip temp \n");
src/thd_zone.cpp:                               thd_log_info("updating existing trip temp \n");
src/thd_zone.cpp:                       thd_log_debug("updating existing trip temp \n");
src/thd_zone.h:         thd_log_debug("zone %s bounded \n", type_str.c_str());
src/thd_zone.h:         thd_log_info("..sensors.. \n");
src/thd_zone.h:         thd_log_info("..trips.. \n");
src/thd_zone_cpu.cpp:   thd_log_debug("zone dts syfs: %s, package id %d \n", path.c_str(),
src/thd_zone_cpu.cpp:           thd_log_error("DTS temperature path not found \n");
src/thd_zone_cpu.cpp:           thd_log_info("Trying to bind hwmon sensor \n");
src/thd_zone_cpu.cpp:                   thd_log_info("Bind hwmon sensor \n");
src/thd_zone_dynamic.cpp:               thd_log_warn("dynamic sensor: invalid sensor type \n");
src/thd_zone_dynamic.cpp:               thd_log_warn("dynamic sensor: invalid sensor type \n");
src/thd_zone_generic.cpp:                       thd_log_error("XML zone: invalid sensor type \n");
src/thd_zone_kbl_amdgpu.cpp:    thd_log_info("cthd_zone_kbl_amdgpu::read_trip_points \n");
src/thd_zone_kbl_g_mcp.cpp:     thd_log_info("cthd_zone_kbl_g_mcp::read_trip_points \n");
src/thd_zone_therm_sys_fs.cpp:                  thd_log_debug("read_trip_points %s:%s \n",
src/thd_zone_therm_sys_fs.cpp:                  thd_log_debug("read_trip_points %s:%s \n",
src/thd_zone_therm_sys_fs.cpp:                  thd_log_debug("read_trip_points %s:%s \n",
src/thd_zone_therm_sys_fs.cpp:  thd_log_debug("read_trip_points Added from sysfs %d trips \n", trip_point_cnt);
src/thd_zone_therm_sys_fs.cpp:  thd_log_debug(" >> read_cdev_trip_points for \n");
src/thd_zone_therm_sys_fs.cpp:                  "cthd_sysfs_zone::read_cdev_trip_points: ZONE bound to CDEV status %d \n",
spandruvada commented 1 month ago

Not intentional. I think this is by eclipse code formatting.

spandruvada commented 3 weeks ago

Fixed.