module_param(oops_only, bool, 0600);
 MODULE_PARM_DESC(oops_only, "Only log oops messages");
 
+#define NETCONSOLE_PARAM_TARGET_PREFIX "cmdline"
+
 #ifndef        MODULE
 static int __init option_setup(char *opt)
 {
 {
 }
 
+static void populate_configfs_item(struct netconsole_target *nt,
+                                  int cmdline_count)
+{
+}
 #endif /* CONFIG_NETCONSOLE_DYNAMIC */
 
 /* Allocate and initialize with defaults.
        },
 };
 
+static void populate_configfs_item(struct netconsole_target *nt,
+                                  int cmdline_count)
+{
+       char target_name[16];
+
+       snprintf(target_name, sizeof(target_name), "%s%d",
+                NETCONSOLE_PARAM_TARGET_PREFIX, cmdline_count);
+       config_item_init_type_name(&nt->item, target_name,
+                                  &netconsole_target_type);
+}
+
 #endif /* CONFIG_NETCONSOLE_DYNAMIC */
 
 /* Handle network interface device notifications */
 }
 
 /* Allocate new target (from boot/module param) and setup netpoll for it */
-static struct netconsole_target *alloc_param_target(char *target_config)
+static struct netconsole_target *alloc_param_target(char *target_config,
+                                                   int cmdline_count)
 {
        struct netconsole_target *nt;
        int err;
        if (err)
                goto fail;
 
+       populate_configfs_item(nt, cmdline_count);
        nt->enabled = true;
 
        return nt;
 {
        int err;
        struct netconsole_target *nt, *tmp;
+       unsigned int count = 0;
        bool extended = false;
        unsigned long flags;
        char *target_config;
 
        if (strnlen(input, MAX_PARAM_LENGTH)) {
                while ((target_config = strsep(&input, ";"))) {
-                       nt = alloc_param_target(target_config);
+                       nt = alloc_param_target(target_config, count);
                        if (IS_ERR(nt)) {
                                err = PTR_ERR(nt);
                                goto fail;
                        spin_lock_irqsave(&target_list_lock, flags);
                        list_add(&nt->list, &target_list);
                        spin_unlock_irqrestore(&target_list_lock, flags);
+                       count++;
                }
        }