All of lore.kernel.org
 help / color / mirror / Atom feed
From: khali@linux-fr.org (Jean Delvare)
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] generic chip support in libsensors
Date: Wed, 18 Oct 2006 15:13:25 +0000	[thread overview]
Message-ID: <20061018171325.3125efc8.khali@linux-fr.org> (raw)
In-Reply-To: <44C78622.8060808@hhs.nl>

Hi Bob,

Sorry for being so quiet, that's because I am very busy, not because
I'm not interested. I _am_ very interested by your work.

I am worried about how you are currently keeping your changes? At some
point we'll have to merge your changes upstream, and we are not going
to take one big patch with all changes. We need incremental changes so
that we can review and test them properly.

It might make sense to open a branch for you in our Subversion
repository so that you can do these incremental commits right now, and
we can comment and review and test as you progress.

On Tue, 17 Oct 2006 00:02:57 +0200, Bob Schl?rmann wrote:
> We are currently almost done with modifying the library so that it
> detects the chip's features from the sysfs entries, it now needs
> some testing. One problem we had was finding a way to add the new
> sensors_chip_features entry to the global list of known chips. This is
> currently handled by making the last places of the global array empty
> placeholders.

This means you put an arbitrary limit to the number of entries which
can be created dynamically. This is certainly OK if this limit is large
enough, as a first approximation. But dynamic entries are supposed to
become the one and only way in the future, so it'd be better if we
could handle them cleanly. This might come naturally when we drop
support for static entries anyway.

> For step 2/3 (modify the sensors tool so the per chip print routines are
> replaced by generic ones) we had some ideas. 
> 
> The first idea was to create a sort of object oriented approach by using
> structs and function pointers, kind of how Gtk works. In the
> OO-model a Sensor class/struct would be the root class and cpu,
> voltage, etc. sensors would be implemented as subclasses. This has the
> advantage (in our opinion) of a clear API and makes adding new sensor
> types easier.
> 
> A simpler approach would be to just create a function that returns the
> correct sensor type given a sensor_chip_feature struct. The sensors app
> can then be restructured around this.

This was my original intent, yes. Just add this function to the
libsensors API and you're done.

> We have currently chosen to first implement the the last approach,
> because this seems more 'incremental', and when there is enough time
> left (there probably will be) implement the oo-model as an extra layer.

I prefer the last approach too. No need to make things more complex
than is required. "sensors" is written in C, not an OO language.
And we haven't been adding a new sensor type in the past 6 years, I
pretty much doubt we'll have to add any in a near future, so no need to
optimize for this unlikely event.

> A patch will be available soon, to show our current progress and
> hopefully to get some feedback whether we took the right path with step
> 1,

Great, looking forward :)

-- 
Jean Delvare


      parent reply	other threads:[~2006-10-18 15:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-26 15:11 [lm-sensors] generic chip support in libsensors Hans de Goede
2006-07-27  1:18 ` Mark M. Hoffman
2006-08-01  8:06 ` Hans de Goede
2006-08-20 10:50 ` Rudolf Marek
2006-08-20 12:26 ` Jean Delvare
2006-08-22 10:01 ` Jean Delvare
2006-08-24 19:32 ` Hans de Goede
2006-08-25  8:31 ` Jean Delvare
2006-09-09 15:13 ` Bob Schlärmann
2006-10-05 13:00 ` Mark M. Hoffman
2006-10-16 20:43 ` Rudolf Marek
2006-10-16 22:02 ` Bob Schlärmann
2006-10-18 15:13 ` Jean Delvare [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061018171325.3125efc8.khali@linux-fr.org \
    --to=khali@linux-fr.org \
    --cc=lm-sensors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.