Skip to contentSkip to conversation

Fix: change default UST per UID subbuffer size

PATCH Mathieu Desnoyers 2 participants 3 messages May 7, 2013 3 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 14 lines · * David Goulet ([email protected]) wrote:

The default per UID subbuffer size are changed from 4096 bytes to 131072 bytes (128k).

Fixes #524

---
 src/bin/lttng-sessiond/channel.c |   40 +++++++++++++++++++++++++-------------
 src/bin/lttng-sessiond/channel.h |    3 ++-
 src/bin/lttng-sessiond/cmd.c     |   14 ++++++++-----
 src/common/defaults.c            |    9 ++++++---
 src/common/defaults.h            |   25 ++++++++++++++++++------
 src/lib/lttng-ctl/lttng-ctl.c    |    6 +++++-
 6 files changed, 67 insertions(+), 30 deletions(-)

[...]

src/common/defaults.h line 152

Quoted 11 lines
src/common/defaults.h +2 -1
index fb6a975..4606976 100644
@@ -148,7 +148,8 @@
 /* User space defaults */
 
 /* Must be a power of 2 */
-#define DEFAULT_UST_CHANNEL_SUBBUF_SIZE     4096    /* bytes */
+#define DEFAULT_UST_PID_CHANNEL_SUBBUF_SIZE 4096    /* bytes */
+#define DEFAULT_UST_UID_CHANNEL_SUBBUF_SIZE 131072  /* bytes */

Since we introduce DEFAULT_UST_{PID,UID}_* for SUBBUF_SIZE, I think it would make sense to introduce PID and UID defaults for SUBBUF_NUM and OUTPUT. They can simply map to their respective DEFAULT_UST_CHANNEL defaults. I recommend we rename DEFAULT_UST_CHANNEL_* defaults to _DEFAULT_UST_CHANNEL_* (leading underscore) so we ensure we don't forget any site that uses the old macro. The code that uses those should always use the UID/PID macros from now on. Having this in place will make it much easier to make default value changes in the future if need be without the risk of forgetting to changes some instances in the code (see commit 9f778c9a8f1d65f5bfdde7cfd7294492d6fdd34c as an example of a case we had to fix an issue that arised from inconsistency).

Moreover, I think you forgot to update the documentation (manpage + enable-channel --help).

Thanks,

Mathieu

Signature · 3 lines
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

A message that is not in the archive (sent off-list or not yet received): 20130507161904.GE6601@Krystal

#3 lore raw

Mathieu Desnoyers:

Quoted 24 lines · * David Goulet ([email protected]) wrote:
Quoted 14 lines

The default per UID subbuffer size are changed from 4096 bytes to 131072 bytes (128k).

Fixes #524

---
 src/bin/lttng-sessiond/channel.c |   40 +++++++++++++++++++++++++-------------
 src/bin/lttng-sessiond/channel.h |    3 ++-
 src/bin/lttng-sessiond/cmd.c     |   14 ++++++++-----
 src/common/defaults.c            |    9 ++++++---
 src/common/defaults.h            |   25 ++++++++++++++++++------
 src/lib/lttng-ctl/lttng-ctl.c    |    6 +++++-
 6 files changed, 67 insertions(+), 30 deletions(-)

[...]

Quoted 7 lines
src/common/defaults.h +0 -0
index fb6a975..4606976 100644
@@ -148,7 +148,8 @@
 /* User space defaults */
 
Quoted 16 lines

src/common/defaults.h line 152

Quoted 4 lines
src/common/defaults.h +2 -1
 /* Must be a power of 2 */
-#define DEFAULT_UST_CHANNEL_SUBBUF_SIZE     4096    /* bytes */
+#define DEFAULT_UST_PID_CHANNEL_SUBBUF_SIZE 4096    /* bytes */
+#define DEFAULT_UST_UID_CHANNEL_SUBBUF_SIZE 131072  /* bytes */

Since we introduce DEFAULT_UST_{PID,UID}_* for SUBBUF_SIZE, I think it would make sense to introduce PID and UID defaults for SUBBUF_NUM and OUTPUT. They can simply map to their respective DEFAULT_UST_CHANNEL defaults. I recommend we rename DEFAULT_UST_CHANNEL_* defaults to _DEFAULT_UST_CHANNEL_* (leading underscore) so we ensure we don't forget any site that uses the old macro. The code that uses those should always use the UID/PID macros from now on. Having this in place will make it much easier to make default value changes in the future if need be without the risk of forgetting to changes some instances in the code (see commit 9f778c9a8f1d65f5bfdde7cfd7294492d6fdd34c as an example of a case we had to fix an issue that arised from inconsistency).

Not sure I understand here. Don't you mean rename DEFAULT_CHANNEL_* with an underscore in order to make sure only domain specific values are used in the code base? or every UST macros that are not used outside the scope of default.h ?

Actually, subbuffer size are accessed through a getter in default.c returning the max() value between our defaults and a page size. That said, this means their should be *no* call site that uses the subbuffer size macro.

Quoted 3 lines

Moreover, I think you forgot to update the documentation (manpage + enable-channel --help).

Right.

Cheers!
David

Quoted 5 lines

Thanks,

Mathieu

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw
Quoted 44 lines · * David Goulet ([email protected]) wrote:

Mathieu Desnoyers:

Quoted 24 lines · * David Goulet ([email protected]) wrote:
Quoted 14 lines

The default per UID subbuffer size are changed from 4096 bytes to 131072 bytes (128k).

Fixes #524

---
 src/bin/lttng-sessiond/channel.c |   40 +++++++++++++++++++++++++-------------
 src/bin/lttng-sessiond/channel.h |    3 ++-
 src/bin/lttng-sessiond/cmd.c     |   14 ++++++++-----
 src/common/defaults.c            |    9 ++++++---
 src/common/defaults.h            |   25 ++++++++++++++++++------
 src/lib/lttng-ctl/lttng-ctl.c    |    6 +++++-
 6 files changed, 67 insertions(+), 30 deletions(-)

[...]

Quoted 7 lines
src/common/defaults.h +0 -0
index fb6a975..4606976 100644
@@ -148,7 +148,8 @@
 /* User space defaults */
 
Quoted 16 lines

src/common/defaults.h line 152

Quoted 4 lines
src/common/defaults.h +2 -1
 /* Must be a power of 2 */
-#define DEFAULT_UST_CHANNEL_SUBBUF_SIZE     4096    /* bytes */
+#define DEFAULT_UST_PID_CHANNEL_SUBBUF_SIZE 4096    /* bytes */
+#define DEFAULT_UST_UID_CHANNEL_SUBBUF_SIZE 131072  /* bytes */

Since we introduce DEFAULT_UST_{PID,UID}_* for SUBBUF_SIZE, I think it would make sense to introduce PID and UID defaults for SUBBUF_NUM and OUTPUT. They can simply map to their respective DEFAULT_UST_CHANNEL defaults. I recommend we rename DEFAULT_UST_CHANNEL_* defaults to _DEFAULT_UST_CHANNEL_* (leading underscore) so we ensure we don't forget any site that uses the old macro. The code that uses those should always use the UID/PID macros from now on. Having this in place will make it much easier to make default value changes in the future if need be without the risk of forgetting to changes some instances in the code (see commit 9f778c9a8f1d65f5bfdde7cfd7294492d6fdd34c as an example of a case we had to fix an issue that arised from inconsistency).

Quoted 4 lines

Not sure I understand here. Don't you mean rename DEFAULT_CHANNEL_* with an underscore in order to make sure only domain specific values are used in the code base? or every UST macros that are not used outside the scope of default.h ?

Resolved by phone discussion. I look forward to the updated patch.

Thanks,

Mathieu

Quoted 20 lines

Actually, subbuffer size are accessed through a getter in default.c returning the max() value between our defaults and a page size. That said, this means their should be *no* call site that uses the subbuffer size macro.

Quoted 3 lines

Moreover, I think you forgot to update the documentation (manpage + enable-channel --help).

Right.

Cheers!
David

Quoted 5 lines

Thanks,

Mathieu

Signature · 3 lines
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com