~ubuntu-branches/ubuntu/trusty/linux-armadaxp/trusty

« back to all changes in this revision

Viewing changes to fs/ocfs2/cluster/netdebug.c

  • Committer: Package Import Robot
  • Author(s): Michael Casadevall, Bryan Wu, Dann Frazier, Michael Casadeall
  • Date: 2012-03-10 15:00:54 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20120310150054-flugb39zon8vvgwe
Tags: 3.2.0-1600.1
[ Bryan Wu ]
* UBUNTU: import debian/debian.env and debian.armadaxp

[ Dann Frazier ]
* ARM: Armada XP: remove trailing '/' in dirnames in mvRules.mk

[ Michael Casadeall ]
* tools: add some tools for Marvell Armada XP processor
* kernel: timer tick hacking from Marvell
* kernel: Sheeva Errata: add delay on Sheeva when powering down
* net: add Marvell NFP netfilter
* net: socket and skb modifications made by Marvell
* miscdevice: add minor IDs for some Marvell Armada drivers
* fs: introduce memory pool for splice()
* video: EDID detection updates from Marvell Armada XP patchset
* video: backlight: add Marvell Dove LCD backlight driver
* video: display: add THS8200 display driver
* video: framebuffer: add Marvell Dove and Armada XP processor onchip LCD controller driver
* usbtest: add Interrupt transfer testing by Marvell Armada XP code
* usb: ehci: add support for Marvell EHCI controler
* tty/serial: 8250: add support for Marvell Armada XP processor and DeviceTree work
* rtc: add support for Marvell Armada XP onchip RTC controller
* net: pppoe: add Marvell ethernet NFP hook in PPPoE networking driver
* mtd: nand: add support for Marvell Armada XP Nand Flash Controller
* mtd: maps: add Marvell Armada XP specific map driver
* mmc: add support for Marvell Armada XP MMC/SD host controller
* i2c: add support for Marvell Armada XP onchip i2c bus controller
* hwmon: add Kconfig option for Armada XP onchip thermal sensor driver
* dmaengine: add Net DMA support for splice and update Marvell XOR DMA engine driver
* ata: add support for Marvell Armada XP SATA controller and update some quirks
* ARM: add Marvell Armada XP machine to mach-types
* ARM: oprofile: add support for Marvell PJ4B core
* ARM: mm: more ARMv6 switches for Marvell Armada XP
* ARM: remove static declaration to allow compilation
* ARM: alignment access fault trick
* ARM: mm: skip some fault fixing when run on NONE SMP ARMv6 mode during early abort event
* ARM: mm: add Marvell Sheeva CPU Architecture for PJ4B
* ARM: introduce optimized copy operation for Marvell Armada XP
* ARM: SAUCE: hardware breakpoint trick for Marvell Armada XP
* ARM: big endian and little endian tricks for Marvell Armada XP
* ARM: SAUCE: Add Marvell Armada XP build rules to arch/arm/kernel/Makefile
* ARM: vfp: add special handling for Marvell Armada XP
* ARM: add support for Marvell U-Boot
* ARM: add mv_controller_num for ARM PCI drivers
* ARM: add support for local PMUs, general SMP tweaks and cache flushing
* ARM: add Marvell device identifies in glue-proc.h
* ARM: add IPC driver support for Marvell platforms
* ARM: add DMA mapping for Marvell platforms
* ARM: add Sheeva errata and PJ4B code for booting
* ARM: update Kconfig and Makefile to include Marvell Armada XP platforms
* ARM: Armada XP: import LSP from Marvell for Armada XP 3.2 kernel enablement

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
#define SC_DEBUG_NAME           "sock_containers"
48
48
#define NST_DEBUG_NAME          "send_tracking"
49
49
#define STATS_DEBUG_NAME        "stats"
 
50
#define NODES_DEBUG_NAME        "connected_nodes"
50
51
 
51
52
#define SHOW_SOCK_CONTAINERS    0
52
53
#define SHOW_SOCK_STATS         1
55
56
static struct dentry *sc_dentry;
56
57
static struct dentry *nst_dentry;
57
58
static struct dentry *stats_dentry;
 
59
static struct dentry *nodes_dentry;
58
60
 
59
61
static DEFINE_SPINLOCK(o2net_debug_lock);
60
62
 
491
493
        .release = sc_fop_release,
492
494
};
493
495
 
 
496
static int o2net_fill_bitmap(char *buf, int len)
 
497
{
 
498
        unsigned long map[BITS_TO_LONGS(O2NM_MAX_NODES)];
 
499
        int i = -1, out = 0;
 
500
 
 
501
        o2net_fill_node_map(map, sizeof(map));
 
502
 
 
503
        while ((i = find_next_bit(map, O2NM_MAX_NODES, i + 1)) < O2NM_MAX_NODES)
 
504
                out += snprintf(buf + out, PAGE_SIZE - out, "%d ", i);
 
505
        out += snprintf(buf + out, PAGE_SIZE - out, "\n");
 
506
 
 
507
        return out;
 
508
}
 
509
 
 
510
static int nodes_fop_open(struct inode *inode, struct file *file)
 
511
{
 
512
        char *buf;
 
513
 
 
514
        buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
 
515
        if (!buf)
 
516
                return -ENOMEM;
 
517
 
 
518
        i_size_write(inode, o2net_fill_bitmap(buf, PAGE_SIZE));
 
519
 
 
520
        file->private_data = buf;
 
521
 
 
522
        return 0;
 
523
}
 
524
 
 
525
static int o2net_debug_release(struct inode *inode, struct file *file)
 
526
{
 
527
        kfree(file->private_data);
 
528
        return 0;
 
529
}
 
530
 
 
531
static ssize_t o2net_debug_read(struct file *file, char __user *buf,
 
532
                                size_t nbytes, loff_t *ppos)
 
533
{
 
534
        return simple_read_from_buffer(buf, nbytes, ppos, file->private_data,
 
535
                                       i_size_read(file->f_mapping->host));
 
536
}
 
537
 
 
538
static const struct file_operations nodes_fops = {
 
539
        .open           = nodes_fop_open,
 
540
        .release        = o2net_debug_release,
 
541
        .read           = o2net_debug_read,
 
542
        .llseek         = generic_file_llseek,
 
543
};
 
544
 
 
545
void o2net_debugfs_exit(void)
 
546
{
 
547
        debugfs_remove(nodes_dentry);
 
548
        debugfs_remove(stats_dentry);
 
549
        debugfs_remove(sc_dentry);
 
550
        debugfs_remove(nst_dentry);
 
551
        debugfs_remove(o2net_dentry);
 
552
}
 
553
 
494
554
int o2net_debugfs_init(void)
495
555
{
 
556
        mode_t mode = S_IFREG|S_IRUSR;
 
557
 
496
558
        o2net_dentry = debugfs_create_dir(O2NET_DEBUG_DIR, NULL);
497
 
        if (!o2net_dentry) {
498
 
                mlog_errno(-ENOMEM);
499
 
                goto bail;
500
 
        }
501
 
 
502
 
        nst_dentry = debugfs_create_file(NST_DEBUG_NAME, S_IFREG|S_IRUSR,
503
 
                                         o2net_dentry, NULL,
504
 
                                         &nst_seq_fops);
505
 
        if (!nst_dentry) {
506
 
                mlog_errno(-ENOMEM);
507
 
                goto bail;
508
 
        }
509
 
 
510
 
        sc_dentry = debugfs_create_file(SC_DEBUG_NAME, S_IFREG|S_IRUSR,
511
 
                                        o2net_dentry, NULL,
512
 
                                        &sc_seq_fops);
513
 
        if (!sc_dentry) {
514
 
                mlog_errno(-ENOMEM);
515
 
                goto bail;
516
 
        }
517
 
 
518
 
        stats_dentry = debugfs_create_file(STATS_DEBUG_NAME, S_IFREG|S_IRUSR,
519
 
                                           o2net_dentry, NULL,
520
 
                                           &stats_seq_fops);
521
 
        if (!stats_dentry) {
522
 
                mlog_errno(-ENOMEM);
523
 
                goto bail;
524
 
        }
525
 
 
526
 
        return 0;
527
 
bail:
528
 
        debugfs_remove(stats_dentry);
529
 
        debugfs_remove(sc_dentry);
530
 
        debugfs_remove(nst_dentry);
531
 
        debugfs_remove(o2net_dentry);
 
559
        if (o2net_dentry)
 
560
                nst_dentry = debugfs_create_file(NST_DEBUG_NAME, mode,
 
561
                                        o2net_dentry, NULL, &nst_seq_fops);
 
562
        if (nst_dentry)
 
563
                sc_dentry = debugfs_create_file(SC_DEBUG_NAME, mode,
 
564
                                        o2net_dentry, NULL, &sc_seq_fops);
 
565
        if (sc_dentry)
 
566
                stats_dentry = debugfs_create_file(STATS_DEBUG_NAME, mode,
 
567
                                        o2net_dentry, NULL, &stats_seq_fops);
 
568
        if (stats_dentry)
 
569
                nodes_dentry = debugfs_create_file(NODES_DEBUG_NAME, mode,
 
570
                                        o2net_dentry, NULL, &nodes_fops);
 
571
        if (nodes_dentry)
 
572
                return 0;
 
573
 
 
574
        o2net_debugfs_exit();
 
575
        mlog_errno(-ENOMEM);
532
576
        return -ENOMEM;
533
577
}
534
578
 
535
 
void o2net_debugfs_exit(void)
536
 
{
537
 
        debugfs_remove(stats_dentry);
538
 
        debugfs_remove(sc_dentry);
539
 
        debugfs_remove(nst_dentry);
540
 
        debugfs_remove(o2net_dentry);
541
 
}
542
 
 
543
579
#endif  /* CONFIG_DEBUG_FS */