Mi version command: add commit version to mi version
authorJonathan Rajotte Julien <Jonathan.rajotte-julien@ericsson.com>
Thu, 15 May 2014 16:10:17 +0000 (12:10 -0400)
committerJonathan Rajotte Julien <jonathan.r.julien@gmail.com>
Tue, 22 Jul 2014 20:14:56 +0000 (16:14 -0400)
src/bin/lttng/commands/version.c
src/common/mi-lttng.c
src/common/mi-lttng.h
src/common/mi_lttng.xsd

index d27013689635aac7536b74db8c5cd753620e816b..8631cf9482cce8f853fa4dd8530a6c1f9bf600da 100644 (file)
@@ -65,6 +65,7 @@ static void create_version(struct mi_lttng_version *version)
        version->version_major = VERSION_MAJOR;
        version->version_minor = VERSION_MINOR;
        version->version_patchlevel = VERSION_PATCHLEVEL;
+       strncpy(version->version_commit, FULL_VERSION, NAME_MAX);
        strncpy(version->version_name, VERSION_NAME, NAME_MAX);
        strncpy(version->package_url, PACKAGE_URL, NAME_MAX);
 }
index 02500ff14fe0a0df4f9ad9f94047e65f346553e1..7364c5d82ce8a6a9b85acf9ee771a0c6210ff488 100644 (file)
@@ -36,6 +36,7 @@ const char * const mi_lttng_element_version_str = "string";
 const char * const mi_lttng_element_version_web = "url";
 const char * const mi_lttng_element_version_major = "major";
 const char * const mi_lttng_element_version_minor = "minor";
+const char * const mi_lttng_element_version_commit = "commit";
 const char * const mi_lttng_element_version_license = "license";
 const char * const mi_lttng_element_version_patch_level = "patchLevel";
 const char * const mi_lttng_element_version_description = "description";
@@ -372,6 +373,13 @@ int mi_lttng_version(struct mi_writer *writer, struct mi_lttng_version *version,
                goto end;
        }
 
+       /* Commit version number */
+       ret = mi_lttng_writer_write_element_string(writer,
+                       mi_lttng_element_version_commit, version->version_commit);
+       if (ret) {
+               goto end;
+       }
+
        /* Patch number */
        ret = mi_lttng_writer_write_element_unsigned_int(writer,
                        mi_lttng_element_version_patch_level, version->version_patchlevel);
index f033bd7701719ce91159d34302d9b8143078522c..e2b5de71c10d14f88ec41270371475b97ec1bc5e 100644 (file)
@@ -40,6 +40,7 @@ struct mi_lttng_version {
        uint32_t version_major; /* LTTng-Tools major version number */
        uint32_t version_minor; /* LTTng-Tools minor version number */
        uint32_t version_patchlevel; /* LTTng-Tools patchlevel version number */
+       char version_commit[NAME_MAX]; /* Commit hash of the current version */
        char version_name[NAME_MAX];
        char package_url[NAME_MAX]; /* Define to the home page for this package. */
 };
@@ -58,6 +59,7 @@ const char * const mi_lttng_element_version_web;
 const char * const mi_lttng_element_version_major;
 const char * const mi_lttng_element_version_minor;
 const char * const mi_lttng_element_version_license;
+const char * const mi_lttng_element_version_commit;
 const char * const mi_lttng_element_version_patch_level;
 const char * const mi_lttng_element_version_description;
 
index 6fc25c6b7665fd88bbb5e506040c5411826219dc..d41b1eda1f75574ab3a4f8d9bcf6ae35f3241b43 100644 (file)
@@ -153,6 +153,7 @@ THE SOFTWARE.
                        <xs:element name="major" type="uint32_type" />
                        <xs:element name="url" type="xs:string" />
                        <xs:element name="minor" type="uint32_type" />
+                       <xs:element name="commit" type="xs:string" />
                        <xs:element name="license" type="xs:string" />
                        <xs:element name="patchLevel" type="uint32_type" />
                        <xs:element name="description" type="xs:string" />
This page took 0.028522 seconds and 4 git commands to generate.