+}
+
+static
+void hostname_get_value(struct lttng_ctx_field *field,
+ struct lttng_probe_ctx *lttng_probe_ctx,
+ union lttng_ctx_value *value)
+{
+ struct nsproxy *nsproxy;
+ struct uts_namespace *ns;
+ char *hostname;
+
+ /*
+ * No need to take the RCU read-side lock to read current
+ * nsproxy. (documented in nsproxy.h)
+ */
+ nsproxy = current->nsproxy;
+ if (nsproxy) {
+ ns = nsproxy->uts_ns;
+ hostname = ns->name.nodename;
+ } else {
+ hostname = "";
+ }
+ value->str = hostname;