Skip to contentSkip to conversation

sensors-detect: Print kernel version and processor info

PATCH In review Jean Delvare 2 participants 2 messages Sep 10, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sensors-detect: Print kernel version and processor info

Print the kernel version and the processor information, to make user support easier.
---
Guenter, what do you think? These are questions we often end up asking to the user, so gathering the answers early should save us some time. If you think any other piece of information should be included too, please let me know.

 prog/detect/sensors-detect |   13 +++++++++++++
 1 file changed, 13 insertions(+)
prog/detect/sensors-detect +13 -0
@@ -2731,6 +2731,11 @@ sub initialize_kernel_version
 	}
 }
 
+sub print_kernel_version
+{
+	printf "# Kernel: \%d.\%d.\%d\%s \%s\n", @kernel_version, $kernel_arch;
+}
+
 sub kernel_version_at_least
 {
 	my ($vers, $plvl, $slvl) = @_;
@@ -2775,6 +2780,12 @@ sub initialize_cpu_list
 	push @cpu, $entry if scalar keys(%{$entry}); # Last entry
 }
 
+sub print_cpu_info
+{
+	my $cpu = $cpu[0];
+	print "# Processor: $cpu->{'model name'} ($cpu->{'cpu family'}/$cpu->{model}/$cpu->{stepping})\n";
+}
+
 # @i2c_adapters is a list of references to hashes, one hash per I2C/SMBus
 # adapter present on the system. Each entry has the following keys: path,
 # parent, name (directly taken from sysfs), driver and autoload.
@@ -7027,6 +7038,8 @@ sub main
 	print "# sensors-detect revision $revision\n";
 	initialize_dmi_data();
 	print_dmi_summary();
+	print_kernel_version();
+	print_cpu_info();
 	print "\n";
 
 	if ($opt{auto}) {
Signature · 7 lines
Jean Delvare
SUSE L3 Support

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#1 lore raw
Quoted 8 lines · Jean Delvare

Print the kernel version and the processor information, to make user support easier.
---
Guenter, what do you think? These are questions we often end up asking to the user, so gathering the answers early should save us some time. If you think any other piece of information should be included too, please let me know.

Makes sense. Go for it.

Guenter

Quoted 33 lines
  prog/detect/sensors-detect |   13 +++++++++++++
  1 file changed, 13 insertions(+)
prog/detect/sensors-detect +11 -0
@@ -2731,6 +2731,11 @@ sub initialize_kernel_version
  	}
  }
 
+sub print_kernel_version
+{
+	printf "# Kernel: \%d.\%d.\%d\%s \%s\n", @kernel_version, $kernel_arch;
+}
+
  sub kernel_version_at_least
  {
  	my ($vers, $plvl, $slvl) = @_;
@@ -2775,6 +2780,12 @@ sub initialize_cpu_list
  	push @cpu, $entry if scalar keys(%{$entry}); # Last entry
  }
 
+sub print_cpu_info
+{
+	my $cpu = $cpu[0];
+	print "# Processor: $cpu->{'model name'} ($cpu->{'cpu family'}/$cpu->{model}/$cpu->{stepping})\n";
+}
+
  # @i2c_adapters is a list of references to hashes, one hash per I2C/SMBus
  # adapter present on the system. Each entry has the following keys: path,
  # parent, name (directly taken from sysfs), driver and autoload.

prog/detect/sensors-detect sub main · line 7045

Quoted 8 lines
prog/detect/sensors-detect +2 -0
@@ -7027,6 +7038,8 @@ sub main
  	print "# sensors-detect revision $revision\n";
  	initialize_dmi_data();
  	print_dmi_summary();
+	print_kernel_version();
+	print_cpu_info();
  	print "\n";
 
  	if ($opt{auto}) {

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors