2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License, version 2, as
4 * published by the Free Software Foundation.
6 * Copyright (C) 2017 Hari Bathini, IBM Corporation
9 #include "namespaces.h"
16 struct namespaces *namespaces__new(struct namespaces_event *event)
18 struct namespaces *namespaces;
19 u64 link_info_size = ((event ? event->nr_namespaces : NR_NAMESPACES) *
20 sizeof(struct perf_ns_link_info));
22 namespaces = zalloc(sizeof(struct namespaces) + link_info_size);
26 namespaces->end_time = -1;
29 memcpy(namespaces->link_info, event->link_info, link_info_size);
34 void namespaces__free(struct namespaces *namespaces)