Re: statistics infrastructure (in -mm tree) review



On Tue, Jun 13, 2006 at 05:18:27PM -0700, Randy.Dunlap wrote:
On Tue, 13 Jun 2006 16:47:39 -0700 Greg KH wrote:
+/**
+ * struct statistic_info - description of a class of statistics
+ * @name: pointer to name name string
+ * @x_unit: pointer to string describing unit of X of (X, Y) data pair
+ * @y_unit: pointer to string describing unit of Y of (X, Y) data pair
+ * @flags: only flag so far (distinction of incremental and other statistic)
+ * @defaults: pointer to string describing defaults setting for attributes
+ *
+ * Exploiters must setup an array of struct statistic_info for a
+ * corresponding array of struct statistic, which are then pointed to
+ * by struct statistic_interface.
+ *
+ * Struct statistic_info and all members and addressed strings must stay for
+ * the lifetime of corresponding statistics created with statistic_create().
+ *
+ * Except for the name string, all other members may be left blank.
+ * It would be nice of exploiters to fill it out completely, though.
+ */
+struct statistic_info {
+/* public: */
+ char *name;
+ char *x_unit;
+ char *y_unit;
+ int flags;
+ char *defaults;
+};

The whole "public:" and "private:" thing in these structures is not
needed. Just document it in the kernel-doc comments and you should be
fine. This isn't C++ :)

but public: and private: are kernel-doc comments...
Using "private:" causes those fields to be omitted from the
generated documentation because those fields are for internal/private
use of the (statistics) infrastructure code, not to be used by
its clients (er, ugh, exploiters) etc.

Oh, I didn't realize that kerneldoc could do that now, nice. And look,
it's even documented that it can support that, I'll shut up now :)

thanks,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: how to store list of varying types
    ... When there's a variable-length string, ... typedef struct { ... pointer null, and the second one the CString object. ... then have to finish constructing the packet by copying the two data objects ...
    (microsoft.public.vc.mfc)
  • Re: Managed dll and native c dll
    ... I want to pass a pointer to pin pointer to the function. ... struct ManagedDesc1 ... String str1; ... now pass to native dll struct Nativedesc1. ...
    (microsoft.public.dotnet.framework.interop)
  • Re: A C Adventure: your comments are welcome
    ... void * usrRightSegment; ... That is a string is a binary tree of segments, ... struct inside a struct either as the thing itself or as a pointer ... because C makes it easy to change pointer type. ...
    (comp.lang.c)
  • Re: Help with C->C# Port
    ... char is a character. ... you would use a string in C# ... - **char is a pointer to a pointer of char. ... There are struct in C# too. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Another spinoza challenge
    ... You should test against the int type's limits: ... typedef struct complex ... a pointer to an integer ... A macro is preferable because it is replaced by inline code, ...
    (comp.lang.c)