A Taxonomy of Comments

Total Page:16

File Type:pdf, Size:1020Kb

A Taxonomy of Comments A Taxonomy of Comments Or a Critique of C and OS Code Through Comments Yoann Padiolean and Lin Tan September 10, 2008 Contents 1 Overview 4 2 Meta Information() 7 3 Past and Future() 10 3.1 Todo() . 10 3.2 Reminder() . 11 3.3 Trigger, deprecated and obsolete() . 13 3.4 OldCode() . 14 3.5 Log() . 15 4 Explanation() 17 4.1 Example() . 17 4.2 Specific Explanations() . 17 4.2.1 For Explanations() . 18 4.2.2 Bit Explanations() . 20 4.2.3 List Explanations() . 20 4.3 Other specific explanations() . 20 4.4 ShortNameExlain () . 20 4.5 Ref() . 21 4.6 Diagram() . 21 4.7 Font() . 23 4.8 Other . 25 4.8.1 Brief . 25 4.8.2 Summary . 25 4.8.3 Long . 25 5 Type() 29 5.1 NULL() . 29 5.2 Bound() . 31 5.3 Range() . 31 5.4 Unit() . 32 5.5 State type() . 33 5.6 Region pointers() . 33 5.7 Dependent types() . 34 5.7.1 Array dependent types() . 34 5.7.2 Union dependent types() . 34 5.8 Relation types() . 35 5.9 Memory types() . 36 5.10 Bit and bytes() . 36 1 5.10.1 Bitset . 36 5.10.2 cpplint . 37 5.10.3 Group . 37 5.10.4 Devil . 38 5.11 Polymorphism, template types() . 41 5.12 Shape . 41 5.13 Abuse int(), Abuse string() . 41 5.14 Not seen in comments . 41 6 Interface() 42 6.1 Pre conditions() . 42 6.2 InOut() . 43 6.3 Context() . 45 6.3.1 Context Lock() . 45 6.3.2 Context Caller() . 49 6.3.3 Context Interrupt() . 49 6.3.4 Other context . 50 6.3.5 SmPL . 52 6.3.6 Buffer Ownership() . 52 6.4 Effects() . 52 6.5 Error() . 53 6.6 Magic number() . 57 6.7 Module interface() . 59 6.8 Time and Space properties() . 60 6.9 Other interface() . 61 7 Code Relationships() 62 7.1 File organization() . 63 7.1.1 Visual organization() . 63 7.1.2 Grouping() . 64 7.2 EndOfXXX() . 65 7.3 Control Flow() . 66 7.3.1 Caller Callee() . 66 7.3.2 Before After() . 67 7.3.3 Other . 68 7.3.4 Unreached() . 69 7.3.5 ProblematicControl() and FALLTHRU() . 69 7.3.6 Else Explanation() . 70 7.4 Data Flow() . 70 7.4.1 Unused() and ARGSUSED() . 72 7.5 Other code-data correlations() . 73 7.5.1 DataClump() . 73 7.5.2 StructInitialize() . 74 7.5.3 Lock variables correlations() . 75 7.5.4 Protocol() . 77 7.6 Repeat() . 78 7.6.1 Repeat type() . 78 7.6.2 Repeat parameters() . 78 7.7 Designator() . 79 7.7.1 DesignatorField() . 80.
Recommended publications
  • The Challenges of Dynamic Network Interfaces
    The Challenges of Dynamic Network Interfaces by Brooks Davis brooks@{aero,FreeBSD}.org The Aerospace Corporation The FreeBSD Project EuroBSDCon 2004 October 29-31, 2004 Karlsruhe, Germany Introduction ● History of Dynamic Interfaces ● Problems ● Possible Solutions ● Advice to Implementors ● Future Work Early UNIX ● Totally static. ● All devices must be compiled in to kernel ● Fast and easy to program ● Difficult to maintain as the number of devices grows Autoconfiguration ● Introduced in 4.1BSD (June 1981) ● One kernel can serve multiple hardware configurations ● Probe – Test for existence of devices, either using stored addresses or matching devices on self-identifying buses ● Attach – Allocate a driver instance (as of 6.0, this must be fully dynamic) Kernel Modules ● Allows drivers to be added at run time ● LKM (Loadable Kernel Modules) – Introduced in 2.0 by Terry Lambert – Modeled after the facility in SunOS ● KLD (dynamic kernel linker) – Introduced along with newbus in 3.0 by Doug Rabson – Added a generic if_detach() function PC Card & CardBus ● Initial PC Card (PCMCIA) support via PAO in 2.0 ● Fairly good support in 3.0 ● Most PAO changes merged in 4.0 – PAO development ceased ● CardBus support in 5.0 Other Removable Devices ● USB Ethernet (4.0) ● Firewire (fwe(4) in 4.8, fwip(4) in 5.3) ● Bluetooth (5.2) ● Hot plug PCI ● Compact PCI ● PCI Express ● Express Card Netgraph ● Node implement network functions ● Arbitrary connection of nodes allowed ● ng_iface(4) node creates interfaces on demand Interface Cloning ● Handles most pseudo
    [Show full text]
  • Introduzione Al Mondo Freebsd
    Introduzione al mondo FreeBSD Corso avanzato Netstudent Netstudent http://netstudent.polito.it E.Richiardone [email protected] maggio 2009 CC-by http://creativecommons.org/licenses/by/2.5/it/ The FreeBSD project - 1 ·EÁ un progetto software open in parte finanziato ·Lo scopo eÁ mantenere e sviluppare il sistema operativo FreeBSD ·Nasce su CDROM come FreeBSD 1.0 nel 1993 ·Deriva da un patchkit per 386BSD, eredita codice da UNIX versione Berkeley 1977 ·Per problemi legali subisce un rallentamento, release 2.0 nel 1995 con codice royalty-free ·Dalla release 5.0 (2003) assume la struttura che ha oggi ·Disponibile per x86 32 e 64bit, ia64, MIPS, ppc, sparc... ·La mascotte (Beastie) nasce nel 1984 The FreeBSD project - 2 ·Erede di 4.4BSD (eÁ la stessa gente...) ·Sistema stabile; sviluppo uniforme; codice molto chiaro, ordinato e ben commentato ·Documentazione ufficiale ben curata ·Licenza molto permissiva, spesso attrae aziende per progetti commerciali: ·saltuariamente esterni collaborano con implementazioni ex-novo (i.e. Intel, GEOM, atheros, NDISwrapper, ZFS) ·a volte no (i.e. Windows NT) ·Semplificazione di molte caratteristiche tradizionali UNIX Di cosa si tratta Il progetto FreeBSD include: ·Un sistema base ·Bootloader, kernel, moduli, librerie di base, comandi e utility di base, servizi tradizionali ·Sorgenti completi in /usr/src (~500MB) ·EÁ giaÁ abbastanza completo (i.e. ipfw, ppp, bind, ...) ·Un sistema di gestione per software aggiuntivo ·Ports e packages ·Documentazione, canali di assistenza, strumenti di sviluppo ·i.e. Handbook,
    [Show full text]
  • The Challenges of Dynamic Network Interfaces
    The Challenges of Dynamic Network Interfaces Brooks Davis The FreeBSD Project Seattle, WA brooks@{aero,FreeBSD}.org Abstract vices to the modern age of near complete dynamism. Following this history, the problems caused by this dynamism are discussed in detail. Then solutions to On early BSD systems, network interfaces were some of these problems are proposed and analyzed, static objects created at kernel compile time. To- and advice to implementers of userland applications day the situation has changed dramatically. PC is given. Finally, the issues are summarized and fu- Card, USB, and other removable buses allow hard- ture work is discussed. ware interfaces to arrive and depart at run time. Pseudo-device cloning also allows pseudo-devices to be created dynamically. Additionally, in FreeBSD and Dragonfly, interfaces can be renamed by the ad- 2 History ministrator. With these changes, interfaces are now dynamic objects which may appear, change, or dis- appear at any time. This dynamism invalidates a In early versions of UNIX, the exact set of devices number of assumptions that have been made in the on the system had to be compiled in to the kernel. If kernel, in external programs, and even in standards the administrator attempted to use a device which such as SNMP. This paper explores the history of was compiled in, but not installed, a panic or hang the transition of network interfaces from static to dy- was nearly certain. This system was easy to pro- namic. Issues raised by these changes are discussed gram and efficient to execute. Unfortunately, it was and possible solutions suggested.
    [Show full text]
  • PC-BSD 9 Turns a New Page
    CONTENTS Dear Readers, Here is the November issue. We are happy that we didn’t make you wait for it as long as for October one. Thanks to contributors and supporters we are back and ready to give you some usefull piece of knowledge. We hope you will Editor in Chief: Patrycja Przybyłowicz enjoy it as much as we did by creating the magazine. [email protected] The opening text will tell you What’s New in BSD world. It’s a review of PC-BSD 9 by Mark VonFange. Good reading, Contributing: especially for PC-BSD users. Next in section Get Started you Mark VonFange, Toby Richards, Kris Moore, Lars R. Noldan, will �nd a great piece for novice – A Beginner’s Guide To PF Rob Somerville, Erwin Kooi, Paul McMath, Bill Harris, Jeroen van Nieuwenhuizen by Toby Richards. In Developers Corner Kris Moore will teach you how to set up and maintain your own repository on a Proofreaders: FreeBSD system. It’s a must read for eager learners. Tristan Karstens, Barry Grumbine, Zander Hill, The How To section in this issue is for those who enjoy Christopher J. Umina experimenting. Speed Daemons by Lars R Noldan is a very good and practical text. By reading it you can learn Special Thanks: how to build a highly available web application server Denise Ebery with advanced networking mechanisms in FreeBSD. The Art Director: following article is the �nal one of our GIS series. The author Ireneusz Pogroszewski will explain how to successfully manage and commission a DTP: complex GIS project.
    [Show full text]
  • Absolute BSD—The Ultimate Guide to Freebsd Table of Contents Absolute BSD—The Ultimate Guide to Freebsd
    Absolute BSD—The Ultimate Guide to FreeBSD Table of Contents Absolute BSD—The Ultimate Guide to FreeBSD............................................................................1 Dedication..........................................................................................................................................3 Foreword............................................................................................................................................4 Introduction........................................................................................................................................5 What Is FreeBSD?...................................................................................................................5 How Did FreeBSD Get Here?..................................................................................................5 The BSD License: BSD Goes Public.......................................................................................6 The Birth of Modern FreeBSD.................................................................................................6 FreeBSD Development............................................................................................................7 Committers.........................................................................................................................7 Contributors........................................................................................................................8 Users..................................................................................................................................8
    [Show full text]
  • Governance Structures of Free/Open Source Software Development
    Uitnodiging GOVERNANCE STRUCTURES OF FREE/OPEN 51 SOURCE SOFTWARE DEVELOPMENT Voor het bijwonen van de George Dafermos openbare verdediging van het Modularity theory makes a compelling argument: modular product design increases the potential number of persons that could work on a distributed project and has a positive effect proefschrift: on their labour productivity because it allows them to work independently of each other, with little or no need for central coordination. This doctoral dissertation sets out to put this argument to the test by studying a phenomenon that combines both scale and modularity: Governance Structures Free and open source software (FOSS) development. Its central question is: Does modularity mitigate the adverse effects of increasing scale in FOSS development? of Free/Open Source Software Development In exploring the effect of modularity and increasing scale on the dynamic of development of FreeBSD, a large and well-known FOSS project, over a period of fifteen years, the dissertation addresses several related empirical issues: How are FOSS projects organised? How are they governed? And most interestingly, how do they manage increasing scale? Does their ability to self-organise diminish as they grow larger, thereby necessitating hierarchical coordination? Op maandag 10 december 2012 om 15 uur precies in de Frans Source Software Development Source Software Governance Structures of Free/Open van Hasseltzaal van de Aula van de Technische Universiteit Delft, Mekelweg 5 te Delft The Next Generation Infrastructures Foundation George Dafermos represents an international consortium of knowledge institutions, market players and governmental bodies, which joined forces to cope with the challenges faced Governance Structures by today’s and tomorrow’s infrastructure systems.
    [Show full text]
  • Netmap: a Novel Framework for Fast Packet I/O
    netmap: a novel framework for fast packet I/O Luigi Rizzo,∗ Universita` di Pisa, Italy Abstract high rate raw packet I/O required by these applica- tions is not the intended target of general purpose OSes. Many applications (routers, traffic monitors, firewalls, Raw sockets, the Berkeley Packet Filter [14] (BPF), the etc.) need to send and receive packets at line rate even on AF SOCKET family, and equivalent APIs have been very fast links. In this paper we present netmap, a novel used to build all sorts of network monitors, traffic gen- framework that enables commodity operating systems erators, and generic routing systems. Performance, how- to handle the millions of packets per seconds traversing ever, is inadequate for the millions of packets per sec- 1..10 Gbit/s links, without requiring custom hardware or ond (pps) that can be present on 1..10 Gbit/s links. In changes to applications. search of better performance, some systems (see Sec- In building netmap, we identified and successfully re- tion 3) either run completely in the kernel, or bypass the duced or removed three main packet processing costs: device driver and the entire network stack by exposing per-packet dynamic memory allocations, removed by the NIC’s data structures to user space applications. Ef- preallocating resources; system call overheads, amor- ficient as they may be, many of these approaches depend tized over large batches; and memory copies, elimi- on specific hardware features, give unprotected access to nated by sharing buffers and metadata between kernel hardware, or are poorly integrated with the existing OS and userspace, while still protecting access to device reg- primitives.
    [Show full text]
  • Network Stack Virtualization for Freebsd 7.0 Marko
    Network stack virtualization for FreeBSD 7.0 Marko Zec [email protected] University of Zagreb September 2007. Network stack virtualization for FreeBSD 7.0 slide 1 of 64 Tutorial outline ● Network stack virtualization concepts ● Management interface ● Application scenarios ● Implementation in FreeBSD 7.0 kernel Network stack virtualization for FreeBSD 7.0 slide 2 of 64 Tutorial outline ● Hands-on work encouraged! ● Bootable system image alternatives: – USB stick – LiveCD – VMWare player image ● Neither option will touch anything on your HD ● If already running a recent 7.0-CURRENT, you'll need to copy the kernel from the stick or CD, or compile your own Network stack virtualization for FreeBSD 7.0 slide 3 of 64 Tutorial outline ● Virtualized networking == preview technology – What we learn / try out today might look different in 3 months, particularly the management API – Your input may influence the final version of the virtualization framework ● Do not hesitate to ask questions! Network stack virtualization for FreeBSD 7.0 slide 4 of 64 Server virtualization: two sides of the spectrum VM #1 VM #2 Applications Applications VM #1 VM #2 Operating System Operating System Applications Applications Virtual Machine Virtual Machine Private Resources Private Resources (network, CPU...) (network, CPU...) Virtual Machine Monitor Operating System Physical Machine Physical Machine Strong isolation model Efficient resource utilization Independent OS instances No extra I/O overhead VM migration possible Scaling Network stack virtualization for FreeBSD 7.0
    [Show full text]
  • Introduzione Al Mondo Freebsd Corso Avanzato
    Introduzione al mondo FreeBSD corso Avanzato •Struttura •Installazione •Configurazione •I ports •Gestione •Netstudent http://netstudent.polito.it •E.Richiardone [email protected] •Novembre 2012 •CC-by http://creativecommons.org/licenses/by/3.0/it/ The FreeBSD project - 1 • E` un progetto software open • Lo scopo e` mantenere e sviluppare il sistema operativo FreeBSD • Nasce su CDROM come FreeBSD 1.0 nel 1993 • Deriva da un patchkit per 386BSD, eredita codice da UNIX versione Berkeley 1977 • Per problemi legali subisce un rallentamento, release 2.0 nel 1995 con codice royalty-free • Dalla release 4.0 (2000) assume la struttura che ha oggi • Disponibile per x86 32 e 64bit, ia64, MIPS, ppc, sparc... • La mascotte (Beastie) nasce nel 1984 The FreeBSD project - 2 • Erede di 4.4BSD (e` la stessa gente...) • Sistema stabile; sviluppo uniforme; codice molto chiaro, ordinato e ben commentato • Documentazione ufficiale ben curata • Licenza molto permissiva, spesso attrae aziende per progetti commerciali: • saltuariamente progetti collaborano con implementazioni ex-novo (i.e. Intel, GEOM, NDISwrapper, ZFS, GNU/Linux emulation) • Semplificazione di molte caratteristiche tradizionali UNIX Di cosa si tratta Il progetto FreeBSD include: • Un sistema base • Bootloader, kernel, moduli, librerie di base, comandi e utility di base, servizi tradizionali • Sorgenti completi in /usr/src (~500MB) • E` gia` completo (i.e. ipfw, ppp, bind, ...) • Un sistema di gestione per software aggiuntivo • Ports e packages • Documentazione, canali di assistenza, strumenti
    [Show full text]
  • IRIX® Admin: Networking and Mail (日本語版)
    IRIX® Admin: Networking and Mail (日本語版) ドキュメント番号 007-2860-007JP 編集協力者 執筆 Arthur Evans、Jeffrey B. Zurschmeide 改訂 Pam Sogard、Helen Vanderberg、Bob Bernard、Terry Schultz、Julie Boney 編集 Christina Cary、Cindy Kleinfeld、Susan Wilkening 制作 Amy Swenson、Glen Traefald、Karen Jacobson 技術協力 Scott Henry、Carlin Otto、Kam Kashani、Chris Wagner、Paul Mielke、Robert Stephens、Joe Yetter、Gretchen Helms、John Schimmel、 Robert Mende、Vernon Schryver、 Michael Nelson、Landon Noll イラスト Dany Galgani 本書の著作権について © 1996 - 2002 Silicon Graphics, Inc. All Rights Reserved. このマニュアルには下記の商標・著作に関する注意にある通り、サード・パーティが著作権を保有して いる部分が含まれます。本書の内容の一部あるいは全部について(ソフトウェアを含む)、Silicon Graphics, Inc. から事前に文書による明確な許諾を得ず、いか なる形態においても複写、複製することは禁じられております。 LIMITED AND RESTRICTED RIGHTS LEGEND The electronic (software) version of this document was developed at private expense; if acquired under an agreement with the USA government or any contractor thereto, it is acquired as "commercial computer software" subject to the provisions of its applicable license agreement, as specified in (a) 48 CFR 12.212 of the FAR; or, if acquired for Department of Defense units, (b) 48 CFR 227-7202 of the DoD FAR Supplement; or sections succeeding thereto. Contractor/manufacturer is Silicon Graphics, Inc., 1600 Amphitheatre Pkwy 2E, Mountain View, CA 94043-1351, USA. 商標・著作 IRIX および IRIS は、Silicon Graphics, Inc. の登録商標であり、4DDN、4DLT、Challenge、CHALLENGE、FDDI Visualyzer、IRIS InSight、IRIX NetWorker、 IRIS 4D、NetVisualyzer、Onyx、SGI、および SGI ロゴは、Silicon Graphics, Inc. の商標です。DSI は、Digicom Systems, Inc. の商標です。FLEXlm は、GLOBEtrotter Software, Inc の登録商標です。Hayes は、Hayes Microcomputer Products, Inc. の登録商標です。IBM 3270 は、International Business Machines, Inc. の商標で す。Intel は、Intel Corporation の登録商標です。Macintosh は、Apple Computer Corporation の登録商標です。MS-DOS は、Microsoft Corporation の登録商標 です。Sun と RPC は、Sun Microsystems, Inc.
    [Show full text]
  • IRIX® Admin: Networking and Mail
    IRIX® Admin: Networking and Mail Document Number 007-2860-006 CONTRIBUTORS Written by Arthur Evans and Jeffrey B. Zurschmeide. Updated by Pam Sogard, Helen Vanderberg, Bob Bernard,Terry Schultz, and Julie Boney Edited by Christina Cary, Cindy Kleinfeld, and Susan Wilkening Production by Amy Swenson and Glen Traefald Engineering contributions by Scott Henry, Carlin Otto, Kam Kashani, Chris Wagner, Paul Mielke, Robert Stephens, Joe Yetter, Gretchen Helms, John Schimmel, Robert Mende, Vernon Schryver, Michael Nelson, and Landon Noll Illustrations by Dany Galgani Cover design and illustration by Rob Aguilar, Rikk Carey, Dean Hodgkinson, Erik Lindholm, and Kay Maitz © Copyright 1996 - 2000 Silicon Graphics, Inc.— All Rights Reserved The contents of this document may not be copied or duplicated in any form, in whole or in part, without the prior written permission of Silicon Graphics, Inc. LIMITED AND RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure by the Government is subject to restrictions as set forth in the Rights in Data clause at FAR 52.227-14 and/or in similar or successor clauses in the FAR, or in the DOD, DOE or NASA FAR Supplements. Unpublished rights reserved under the Copyright Laws of the United States. Contractor/manufacturer is SGI, 1600 Amphitheatre Pkwy., Mountain View, CA 94043-1351. Silicon Graphics, Challenge, IRIX,IRIS, and Onyx are registered trademarks and SGI, 4DDN, 4DLT, CHALLENGE, FDDI Visualyzer, IRIS InSight, IRIX NetWorker, IRIS 4D, NetVisualyzer, and the SGI logo are trademarks of Silicon Graphics, Inc. DSI is a trademark of Digicom Systems, Inc. FLEXlm is a trademark of GLOBEtrotter Software, Inc. Hayes is a registered trademark of Hayes Microcomputer Products, Inc.
    [Show full text]
  • Improving Distributed Traffic Generation Performance by Using IMUNES
    Improving distributed traffic generation performance by using IMUNES network emulator Valter Vasic,´ Mirko Suznjeviˇ c,´ Miljenko Mikuc, Maja Matijaseviˇ c´ University of Zagreb, Faculty of Electrical Engineering and Computing, Unska 3, 10000 Zagreb, Croatia {valter.vasic, mirko.suznjevic, miljenko.mikuc, maja.matijasevic}@fer.hr Abstract—In this paper we present improvements of our focusing on generated packed load and bandwidth load, and software architecture for User Behaviour Based Network Traffic measuring saturation of the CPU and RAM usage of the Generation (UrBBan-Gen). It consists of four modules Service PC participating in the traffic generation. This integration repository, Control function and user interface, Behaviour process, and Traffic generation process. Improvements are performed on also enables testing traffic workloads on realistic network the traffic generation process, specifically on the virtualization topologies, thus enabling more precise and detailed tests section of UrBBaN-Gen through integration of the Distributed which can be used to identify problems and bottlenecks in Internet Traffic Generator (D-ITG) which we use as a module the network. for traffic generation with network simulator and emulator The remainder of the paper is organized as follows: in IMUNES. In this way we achieve two goals: 1) better scalability of the traffic generation and 2) possibility for testing of various section 2 we present the related work in the area of behaviour network scenarios in simulated networks under realistic loads. based traffic generation with emphasis on networked games and virtualization techniques, in section 3 we describe the UrBBaN-Gen, in section 4 we explain improvements of the 1. INTRODUCTION emulated environment, section 5 contains the testing method- ology applied, section 6 the results of the measurements, and In recent years Massively Multiplayer Online Role-Playing we conclude the paper in section 7.
    [Show full text]