X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=lttng-statedump-impl.c;h=54a309d15b879d92ca251dacb916c250dc6ba745;hb=e1eb6145438ed8c110ebd5a441f2c7bc5a1d5c34;hp=1c09e51a8ce6a454b4bb8c86b3e079789cc9cfcd;hpb=887bcdac230a9081d5088bde59725edab93b8fb7;p=lttng-modules.git diff --git a/lttng-statedump-impl.c b/lttng-statedump-impl.c index 1c09e51a..54a309d1 100644 --- a/lttng-statedump-impl.c +++ b/lttng-statedump-impl.c @@ -1,4 +1,5 @@ -/* +/* SPDX-License-Identifier: (GPL-2.0 or LGPL-2.1) + * * lttng-statedump.c * * Linux Trace Toolkit Next Generation Kernel State Dump @@ -6,20 +7,6 @@ * Copyright 2005 Jean-Hugues Deschenes * Copyright 2006-2012 Mathieu Desnoyers * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; only - * version 2.1 of the License. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * * Changes: * Eric Clement: Add listing of network IP interface * 2006, 2007 Mathieu Desnoyers Fix kernel threads @@ -41,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -56,7 +42,7 @@ #include #include #include -#include +#include #ifdef CONFIG_LTTNG_HAS_LIST_IRQ #include @@ -152,10 +138,19 @@ int lttng_enumerate_block_devices(struct lttng_session *session) disk_part_iter_init(&piter, disk, DISK_PITER_INCL_PART0); while ((part = disk_part_iter_next(&piter))) { + struct block_device bdev; char name_buf[BDEVNAME_SIZE]; - char *p; + const char *p; + + /* + * Create a partial 'struct blockdevice' to use + * 'bdevname()' which is a simple wrapper over + * 'disk_name()' but has the honor to be EXPORT_SYMBOL. + */ + bdev.bd_disk = disk; + bdev.bd_part = part; - p = wrapper_disk_name(disk, part->partno, name_buf); + p = bdevname(&bdev, name_buf); if (!p) { disk_part_iter_exit(&piter); class_dev_iter_exit(&iter); @@ -397,7 +392,7 @@ void lttng_statedump_process_ns(struct lttng_session *session, do { trace_lttng_statedump_process_state(session, p, type, mode, submode, status, pid_ns); - pid_ns = pid_ns->parent; + pid_ns = pid_ns ? pid_ns->parent : NULL; } while (pid_ns); } @@ -560,7 +555,7 @@ module_exit(lttng_statedump_exit); MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Jean-Hugues Deschenes"); -MODULE_DESCRIPTION("Linux Trace Toolkit Next Generation Statedump"); +MODULE_DESCRIPTION("LTTng statedump provider"); MODULE_VERSION(__stringify(LTTNG_MODULES_MAJOR_VERSION) "." __stringify(LTTNG_MODULES_MINOR_VERSION) "." __stringify(LTTNG_MODULES_PATCHLEVEL_VERSION)