lttng-dev.lists.lttng.org archive mirror
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Cc: lttng-dev <lttng-dev@lists.lttng.org>,
	Jeremie Galarneau <jgalar@efficios.com>
Subject: Re: [PATCH lttng-tools v2 1/4] Save registration time for app
Date: Tue, 13 Aug 2019 16:28:33 -0400 (EDT)	[thread overview]
Message-ID: <1548146053.2292.1565728113064.JavaMail.zimbra__7550.93043423898$1565728129$gmane$org@efficios.com> (raw)
In-Reply-To: <20190813202519.31043-1-jonathan.rajotte-julien@efficios.com>

Merged this patch as well in my dev branch, thanks,

Mathieu

----- On Aug 13, 2019, at 4:25 PM, Jonathan Rajotte jonathan.rajotte-julien@efficios.com wrote:

> Reuse the registration time for path generation.
> 
> Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
> ---
> src/bin/lttng-sessiond/ust-app.c | 7 +++----
> src/bin/lttng-sessiond/ust-app.h | 5 +++++
> 2 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c
> index 4bee50496..443232e79 100644
> --- a/src/bin/lttng-sessiond/ust-app.c
> +++ b/src/bin/lttng-sessiond/ust-app.c
> @@ -1831,15 +1831,12 @@ static void shadow_copy_channel(struct ust_app_channel
> *ua_chan,
> static void shadow_copy_session(struct ust_app_session *ua_sess,
> 		struct ltt_ust_session *usess, struct ust_app *app)
> {
> -	time_t rawtime;
> 	struct tm *timeinfo;
> 	char datetime[16];
> 	int ret;
> 	char tmp_shm_path[PATH_MAX];
> 
> -	/* Get date and time for unique app path */
> -	time(&rawtime);
> -	timeinfo = localtime(&rawtime);
> +	timeinfo = localtime(&app->registration_time);
> 	strftime(datetime, sizeof(datetime), "%Y%m%d-%H%M%S", timeinfo);
> 
> 	DBG2("Shadow copy of session handle %d", ua_sess->handle);
> @@ -3376,6 +3373,8 @@ void ust_app_add(struct ust_app *app)
> 	assert(app);
> 	assert(app->notify_sock >= 0);
> 
> +	app->registration_time = time(NULL);
> +
> 	rcu_read_lock();
> 
> 	/*
> diff --git a/src/bin/lttng-sessiond/ust-app.h b/src/bin/lttng-sessiond/ust-app.h
> index b90ff4bce..d9279f0e4 100644
> --- a/src/bin/lttng-sessiond/ust-app.h
> +++ b/src/bin/lttng-sessiond/ust-app.h
> @@ -298,6 +298,11 @@ struct ust_app {
> 	 * to a negative value indicating that the agent application is gone.
> 	 */
> 	int agent_app_sock;
> +	/*
> +	 * Time at which the app is registred.
> +	 * Used for path creation
> +	 */
> +	time_t registration_time;
> };
> 
> #ifdef HAVE_LIBLTTNG_UST_CTL
> --
> 2.17.1
> 
> _______________________________________________
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

  parent reply	other threads:[~2019-08-13 20:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190813202519.31043-1-jonathan.rajotte-julien@efficios.com>
2019-08-13 20:25 ` [PATCH lttng-tools v2 2/4] Metadata: add env fields to ease lttng path hierarchy creation for viewer Jonathan Rajotte
2019-08-13 20:25 ` [PATCH lttng-tools v2 3/4] Support LTTNG_KERNEL_SESSION_SET_NAME of lttng-modules Jonathan Rajotte
2019-08-13 20:25 ` [PATCH lttng-tools v2 4/4] Support LTTNG_KERNEL_SESSION_SET_CREATION_DATETIME " Jonathan Rajotte
2019-08-13 20:28 ` Mathieu Desnoyers [this message]
2019-09-06 15:37 ` [PATCH lttng-tools v2 1/4] Save registration time for app Jérémie Galarneau
2019-08-13 20:25 Jonathan Rajotte

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='1548146053.2292.1565728113064.JavaMail.zimbra__7550.93043423898$1565728129$gmane$org@efficios.com' \
    --to=mathieu.desnoyers@efficios.com \
    --cc=jgalar@efficios.com \
    --cc=jonathan.rajotte-julien@efficios.com \
    --cc=lttng-dev@lists.lttng.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).