Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CoreTemp module #1664

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

CoreTemp module #1664

wants to merge 17 commits into from

Conversation

sigsegv0x0b
Copy link

Read coretemp values provided by the kernel into collectd

from /sys/devices/platform/coretemp*

Config

"MaxValues", // [ true ], only, none
"ValuesPercentage", // [ true ], false
"ValuesDegrees", // [ true ], false

MaxValues
Provides values only for the hottest core found. Useful if you
have a lot cores but only need to see if there is problems, the single
hottest core reading is good enough for that

ValuesPercentage
Reads the tjmax from coretemp and shows temperature/tjmax*100 rather then actual temperature

ValuesDegrees
Provides core value in degrees

read /sys/devices/platform/coretemp* provided by coretemp kernel module

Config

  "MaxValues",          // [ true ], only, none
  "ValuesPercentage",   // [ true ], false
  "ValuesDegrees",      // [ true ], false

MaxValues
Provides values only for the hottest core found. Useful if you
have a lot cores but only need to see if there is problems, the single
hottest core reading is good enough for that

ValuesPercentage
Reads the tjmax from coretemp and shows temperature/tjmax*100 rather then actual temperature

ValuesDegrees
Provides core value in degrees
configure.ac Outdated
@@ -5390,6 +5390,7 @@ plugin_numa="no"
plugin_perl="no"
plugin_processes="no"
plugin_protocols="no"
plugin_coretemp="no"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep this list sorted.

@sigsegv0x0b
Copy link
Author

cleaned up code via indent -bli 0 src/coretemp.c

@sigsegv0x0b
Copy link
Author

and fixed sorting in autoconf/automake config

@rubenk
Copy link
Contributor

rubenk commented Apr 15, 2016

That made a mess of things. Please look over your changes again. You also missed some of my review comments, which are now gone.

@sigsegv0x0b
Copy link
Author

Would you be able to add standard set of parameters to run thru indent to get the code to comply I am sure it would help everyone and speed up the process of styling code.

https://collectd.org/wiki/index.php/Coding_style ?

I run it thru indent hopefully with sane options

@rubenk
Copy link
Contributor

rubenk commented Apr 15, 2016

Apart from "If you're starting a new file, we recommend to indent with two spaces." we don't have many rules. Any decent editor can do that, I don't think it's worth the effort to codify this for indent.

There's also the danger that your indent tool breaks things, as you can see from your last change. Please look at it again. This diff is just plain wrong.

src/coretemp.c Outdated
};

struct coretemp_core **c = 0;
unsigned int core_count = 0;
unsigned int core_count = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation is wrong here.

src/coretemp.c Outdated
socket = atoi (&de->d_name[CORETEMP_STRLEN]);
if (chdir (de->d_name))
{
ERROR ("coretemp plugin: unable to chdir into [ %s ] for coretemp data",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spaces instead of tabs for this line and the next 3.

@rubenk
Copy link
Contributor

rubenk commented Apr 15, 2016

I went through the file for the fourth time now, but I give up. Please check everything once more before you resubmit.

char *label;
};

struct coretemp_core **c = 0;
Copy link
Contributor

@rubenk rubenk Apr 24, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I commented on this already in my first review.
There's no need to initialise static variables, but if you insist in doing it anyway, please set pointers to NULL, not 0. Please mark as static while you're at it. Can you also pick a bit more descriptive name for a global variable than 'c'?

@ErwanAliasr1
Copy link

Sounds like an interesting plugin. What's missing to get it merged ?

@rpv-tomsk
Copy link
Contributor

The plugin is interesting, but somebody needs to continue work on code so it meet project requirements and standards.

After short review I found another flaws, such as incorrect use of plugin instance, for example.
Also, code might be improved by use of coretemp-hwmon labels.

@collectd-bot collectd-bot changed the base branch from master to main July 3, 2020 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants