Re: [lttng-dev] 回复:Re: 回复:Re: 回复:Re: Pros and Cons of LTTng

2019-11-06 Thread Jonathan Rajotte-Julien
Hi,

On Wed, Nov 06, 2019 at 11:59:41AM +0800, 杨海 wrote:
> Thanks Jonathan. Regarding to the CI MTTR/MTTF test results, it varies from 
> time to time, and on master/stable branches. 
> 1. it monitors new Linux kernels, so the CI job may use newer kernel version 
> than months ago?

Not sure of the question here but here more information on how to jobs works.

The job monitor all kernel tags that we deems pertinent for example for the
vanilla kernel (linux-stable) with the lttng-modules master branch [1]:

  09:13:52 Building the following kernel versions:
  09:13:52 v3.0.101
  09:13:52 v3.1.10
  09:13:52 v3.2.102
  09:13:52 v3.3.8
  09:13:52 v3.4.113
  09:13:52 v3.5.7
  09:13:52 v3.6.11
  09:13:52 v3.7.10
  09:13:52 v3.8.13
  09:13:52 v3.9.11
  09:13:52 v3.10.108
  09:13:52 v3.11.10
  09:13:52 v3.12.74
  09:13:52 v3.13.11
  09:13:52 v3.14.79
  09:13:52 v3.15.10
  09:13:52 v3.16.76
  09:13:52 v3.17.8
  09:13:52 v3.18.140
  09:13:52 v3.19.8
  09:13:52 v4.0.9
  09:13:52 v4.1.52
  09:13:52 v4.2.8
  09:13:52 v4.3.6
  09:13:52 v4.4.199
  09:13:52 v4.5.7
  09:13:52 v4.6.7
  09:13:52 v4.7.10
  09:13:52 v4.8.17
  09:13:52 v4.9.199
  09:13:52 v4.10.17
  09:13:52 v4.11.12
  09:13:52 v4.12.14
  09:13:52 v4.13.16
  09:13:52 v4.14.152
  09:13:52 v4.15.18
  09:13:52 v4.16.18
  09:13:52 v4.17.19
  09:13:52 v4.18.20
  09:13:52 v4.19.82
  09:13:52 v4.20.17
  09:13:52 v5.0.21
  09:13:52 v5.1.21
  09:13:52 v5.2.21
  09:13:52 v5.3.9
  09:13:52 v5.4-rc6

We always track the latest tag of each branch. This does not mean that we do not
support smaller tag of a branch, only that support is a best effort based on
user feedback. Tracking all tags would represent a monumental effort and would
require way more resource overall. Not something we are against, simply that we
do not have the resource for it.

[1] 
https://ci.lttng.org/view/LTTng-modules/job/lttng-modules_master_build-vanilla/

Note the last rc kernel tag.

Note that we also perform this for some distros and their kernels:

https://ci.lttng.org/view/LTTng-modules/job/lttng-modules_master_crossbuild-xenial/
https://ci.lttng.org/view/LTTng-modules/job/lttng-modules_master_crossbuild-bionic/

I guess that it is true that we do not test against past kernel tag for each
branch. Given our history and process, most time that lttng-modules is broken is
that distro are taking liberty on patch backporting. These get fixed asap and
backported to all supported lttng-modules stable branches. 
> 2. What would be the criteria of MTBF here?

Note that these statistics have little to no value here due to the presence of 
the
testing against RC tags. These tags will breaks lttng-modules one way or another
and it is a good thing. This allows us to keep up to date with upstream.
The only pertinent value is the MTTR here. It shows our responsiveness to
external change.

A better representation of our MTTR would be the jobs following distros:

https://ci.lttng.org/view/LTTng-modules/job/lttng-modules_master_build-xenial/

MTTRLast 7 Days0 ms
Last 30 Days   0 ms
All Time   15 hr
MTTFLast 7 Days0 ms
Last 30 Days   0 ms
All Time   4 mo 5 days

Here our MTTR is 15h. Which is quite quick considering the context of tracking
kernel outside of our control.

MTTR is from the moment the CI detect a problem and that we provide a fix for
it.

MTTF is not something we can have control over since the source is completely
external. Except for the rare event that the infrastructure is deficient.

TBH these statistic have little to no meaning in this context.

Cheers

___
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev


Re: [lttng-dev] [PATCH lttng-tools 1/5] Fix: move set base_path of session to URI configuration

2019-11-06 Thread Jérémie Galarneau
Complete series merged in master and stable-2.11.

Thanks!
Jérémie

On Fri, 25 Oct 2019 at 18:12, Jonathan Rajotte
 wrote:
>
> The load code still use the "old" API to create and configure network
> session output (lttng_create_session followed by
> lttng_set_consumer_url). The session base_path is only set in the
> cmd_create_session_from_descriptor function. This results in invalid
> network output path when using a loaded session configuration (xml).
>
> While we might want to move the load code to the new API, there is a case
> to be made in not breaking the previous API behaviour.
>
> To restore the expected behaviour of lttng_set_consumer_url, move the
> assignation of the session base_path to the cmd_set_consumer_uri function
> (LTTNG_SET_CONSUMER_URI).
>
> Both the previous and session descriptor based creation API uses this code
> path when needed (network output).
>
> Signed-off-by: Jonathan Rajotte 
> ---
>
> Note that this is the "base fix". The next 2 commits extracts the added for
> loops into its own function and also remove
> lttng_session_descriptor_get_base_path from the code base. Feel free to 
> "squash"
> them. I was not sure what you would prefer.
>
> ---
>  src/bin/lttng-sessiond/cmd.c | 36 +++-
>  src/bin/lttng-sessiond/session.c | 12 +--
>  src/bin/lttng-sessiond/session.h |  2 +-
>  tests/unit/test_session.c|  4 ++--
>  4 files changed, 30 insertions(+), 24 deletions(-)
>
> diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c
> index a164cffc0..1dec61ea1 100644
> --- a/src/bin/lttng-sessiond/cmd.c
> +++ b/src/bin/lttng-sessiond/cmd.c
> @@ -2759,11 +2759,32 @@ int cmd_set_consumer_uri(struct ltt_session *session, 
> size_t nb_uri,
> goto error;
> }
>
> +   for (i = 0; i < nb_uri; i++) {
> +   if (uris[i].stype != LTTNG_STREAM_CONTROL ||
> +   uris[i].subdir[0] == '\0') {
> +   /* Not interested in these URIs */
> +   continue;
> +   }
> +
> +   if (session->base_path != NULL) {
> +   free(session->base_path);
> +   session->base_path = NULL;
> +   }
> +
> +   /* Set session base_path */
> +   session->base_path = strdup(uris[i].subdir);
> +   if (!session->base_path) {
> +   PERROR("Copying base path: %s", uris[i].subdir);
> +   goto error;
> +   }
> +   DBG2("Setting base path for session %" PRIu64 ": %s",
> +   session->id, session->base_path);
> +   }
> +
> /* Set the "global" consumer URIs */
> for (i = 0; i < nb_uri; i++) {
> -   ret = add_uri_to_consumer(session,
> -   session->consumer,
> -   &uris[i], LTTNG_DOMAIN_NONE);
> +   ret = add_uri_to_consumer(session, session->consumer, 
> &uris[i],
> +   LTTNG_DOMAIN_NONE);
> if (ret != LTTNG_OK) {
> goto error;
> }
> @@ -2894,7 +2915,6 @@ enum lttng_error_code 
> cmd_create_session_from_descriptor(
> const char *session_name;
> struct ltt_session *new_session = NULL;
> enum lttng_session_descriptor_status descriptor_status;
> -   const char *base_path;
>
> session_lock_list();
> if (home_path) {
> @@ -2917,13 +2937,9 @@ enum lttng_error_code 
> cmd_create_session_from_descriptor(
> ret_code = LTTNG_ERR_INVALID;
> goto end;
> }
> -   ret = lttng_session_descriptor_get_base_path(descriptor, &base_path);
> -   if (ret) {
> -   ret_code = LTTNG_ERR_INVALID;
> -   goto end;
> -   }
> +
> ret_code = session_create(session_name, creds->uid, creds->gid,
> -   base_path, &new_session);
> +   &new_session);
> if (ret_code != LTTNG_OK) {
> goto end;
> }
> diff --git a/src/bin/lttng-sessiond/session.c 
> b/src/bin/lttng-sessiond/session.c
> index 383c6fde7..ed68d153f 100644
> --- a/src/bin/lttng-sessiond/session.c
> +++ b/src/bin/lttng-sessiond/session.c
> @@ -962,7 +962,7 @@ end:
>   * Session list lock must be held by the caller.
>   */
>  enum lttng_error_code session_create(const char *name, uid_t uid, gid_t gid,
> -   const char *base_path, struct ltt_session **out_session)
> +   struct ltt_session **out_session)
>  {
> int ret;
> enum lttng_error_code ret_code;
> @@ -1086,16 +1086,6 @@ enum lttng_error_code session_create(const char *name, 
> uid_t uid, gid_t gid,
> }
> }
>
> -   if (base_path) {
> -   new_session->base_path = strdup(base_path);
> -   if (!new_session->base_path) {
> -