+ if (session->kernel_session) {
+ struct ltt_kernel_session *ksess = session->kernel_session;
+
+ if (tmp_sout) {
+ ret = record_kernel_snapshot(ksess, tmp_sout, session, wait);
+ if (ret < 0) {
+ goto error;
+ }
+ } else {
+ struct snapshot_output *sout;
+ struct lttng_ht_iter iter;
+
+ rcu_read_lock();
+ cds_lfht_for_each_entry(session->snapshot.output_ht->ht,
+ &iter.iter, sout, node.node) {
+ ret = record_kernel_snapshot(ksess, sout, session, wait);
+ if (ret < 0) {
+ rcu_read_unlock();
+ goto error;
+ }
+ }
+ rcu_read_unlock();
+ }
+ }
+
+ if (session->ust_session) {
+ struct ltt_ust_session *usess = session->ust_session;
+
+ if (tmp_sout) {
+ ret = record_ust_snapshot(usess, tmp_sout, session, wait);
+ if (ret < 0) {
+ goto error;
+ }
+ } else {
+ struct snapshot_output *sout;
+ struct lttng_ht_iter iter;
+
+ rcu_read_lock();
+ cds_lfht_for_each_entry(session->snapshot.output_ht->ht,
+ &iter.iter, sout, node.node) {
+ ret = record_ust_snapshot(usess, sout, session, wait);
+ if (ret < 0) {
+ rcu_read_unlock();
+ goto error;
+ }
+ }
+ rcu_read_unlock();
+ }
+ }