li linux ux api pi us usage
play

Li Linux ux API PI Us Usage an and Com ompa patibility - PowerPoint PPT Presentation

A Stu tudy dy of of Mod odern ern Li Linux ux API PI Us Usage an and Com ompa patibility tibility : System Building: When You Become a Parent Our experience from building a OS with Linux API support ( Graphene library OS


  1. A Stu tudy dy of of Mod odern ern Li Linux ux API PI Us Usage an and Com ompa patibility tibility :

  2. System Building: When You Become a Parent Our experience from building a OS with Linux API support ( Graphene library OS [Eurosys’14] ): March September October 2011 2012 2013 12 syscalls 131 syscalls Project started When can we claim supported supported having a decent system apache hello world ? gcc makefile etc. API compatibility is measured as all-or-nothing (impractical for system developers)

  3. What to Expect from This Paper: • A method to quantify properties of API support: • From importance of APIs to completeness of systems • Practical, generalizable to other OSes • A study on modern Linux APIs: • Including different API types (e.g., syscalls, ioctl opcodes) • How Linux users rely on Linux APIs • An optimal path to build a Linux-compatible system

  4. Chapter 1 How to Measure API Usage and Compatibility

  5. First Thought: # of APIs or Applications systems APIs (ex: syscalls) applications (support) (use) fire- sys_ladder() JohnnyOS truck.app support 2 APIs or 1 app crane- sys_steer() truck.app EmmaOS sys_lift() lifter.app support 2 APIs or 2 apps Can we conclude who has better API compatibility? (No, we cannot)

  6. Taking Popularity into Consideration users systems APIs applications (support) (use) (install) APIs are not equally popular Neither are applications (e.g., sys_read > sys_sync) (e.g., Bash > CVS) Installation statistics Static binary analysis (e.g., Ubuntu popularity contest) New metrics to reflect both users and app developers’ choices

  7. We Need 2 Metrics for Building API Support • Which APIs should I implement first? API Importance (API usage) • What is the progress of API support in my system? Weighted Completeness (system’s API compatibility)

  8. A Metric for APIs: API Importance Probability that a random user installs API importance = any applications using the API sys_steer() cranetruck.app (installed by 60% of users) (use) crane-truck.app is installed = Pr [ ] firetruck.app or fire-truck.app is installed (installed by ≤ 1- (1-60%)(1-80%) = 92% 80% of users) (upper bound) If the API is missing, how many users will complain?

  9. A Metric for Systems: Weighted Completeness weighted completeness = Fraction of installed applications to be supported by the system, for a random user # cranetruck.app installed (support) E [ ] + # firetruck.app installed ≈ E [ ] # applications installed (installed by (Example: 5 apps in average) 60% of users) ≈ (0.6+0.8) ÷ 5 = 28% (installed by 80% of users) If a user switches to the new system, how many apps will still work?

  10. Quick Summary • API Impor portance tance (for or each h API): ): % of users that install any apps using the APIs • Weighted ighted Complet pletene eness ss (for r the e whole ole system) em): % of a user’s installed apps supported by the system

  11. Chapter 2 A Study of Linux APIs and How It Can Help API Support

  12. A Large-Scale Linux API Study • Applications Sample: Ubuntu 15.04 official repositories 66,275 ELF binaries EXEs linked in 22,459 amd64 packages with LIBs 48% shared LIBs 52% • Installation statistics: Popularity Contest 2.7 million installations (http://popcon.ubuntu.com) 0.2 million installations (http://popcon.debian.org) A large, representative sample to draw meaningful observations

  13. Tons that You Can Find in the Study • For researchers: (in the paper) • Observations to motivate ideas • For maintainers: (in the paper) • Evidences to justify or guide decisions • For builders: • Rationale for prioritizing APIs to implement • Quantifying system building goals

  14. Prioritizing Linux System Calls 224 th Maintainers: API Importance 100% # APIs in heavy use 224 are used 6 completely 45 used by by at least one app unused < 10% for each user 50% Ex: Ex: ustat, Ex: read, exit, clone get_robust_list tee, getcpu mq_notify 257 th move_pages 10% 302 nd 0% 308 in ( ) 0 200 225 250 275 300 Linux 3.19 N-most important system calls Builders: (from the most important to the least important) ranking of APIs Even if importance is ~100%, ranking is meaningful for prioritizing APIs to support

  15. Using API Importance As Heuristic sys_read (1 - 10 -383 ) sys_sync (1 - 10 -8 ) API Importance 100%  Both round up to 100%, but still different Higher-ranking APIs are likely to support more applications for a user Top 3000 packages 50% # packages using Top 2000 packages 600 Top 1000 packages 500 the syscall Last 75 syscalls: 400 used by very few packages 300 (e.g., setdomainname() by 200 hostname) 0% 100 0 200 225 250 275 300 0 0 50 100 150 N-most important system calls N-most important syscalls First 40 syscalls: (from the most important to the least important) used by every packages (must implement first) Ideal for prioritizing APIs to maximize weighted completeness

  16. Evaluating the System while Building It • Goal: maximize weighted completeness • Approach: implement the most important APIs (syscalls) first 145 (+64) 202 (+63) most important 100% most important syscalls Completeness syscalls 90% complete Weighted 50% complete 81 (+41) app: chromium most important app: vnc-server 40 syscalls 50% must-have 10% complete syscalls FreeBSD app: perl app: time Linux layer 225 syscall 62% complete 0% Graphene 145 syscall 0 50 100 150 200 250 21% complete # implemented syscalls More nearly optimal path than only relying on developers’ intuition

  17. More in the Paper • More API types: • Opcodes of vectored syscalls (e.g., ioctl, fcntl, prctl) • Pseudo-files (e.g., /proc, /dev, /sys) • Library functions (e.g., GNU library C) • More systems: e.g., L4Linux, User-Mode-Linux, libc variants • Hints for Maintainers: • When is the timing of deprecation? • Where is the sweet spot of limiting APIs (e.g., for security)? • What is app developers’ preference?

  18. Tool, Data and Code Available Soon! www.oscar.cs.stonybrook.edu/api-compat-study Online Onli ne Evalua Ev aluation T tion Too ool Da Data ta Se Set (2.6 M r t (2.6 M rec ecor ords ds) for or Do Downloa wnload

  19. Conclusions • An API study udy that t reassurin suringly ly answers s the questio stions ns of system stem develope lopers, , from plannin nning g stage e to release ase. • Encourage builders with better methods to strategize/evaluate. • Motivate researchers and justify maintainers’ decisions. • Lesso sons ns for evalu luati ting ng all-or or-nothing ing properti ties es Analysis techniques (e.g., binary analysis) + User studies (e.g., application popularity) Tool / Data / Code: www.oscar.cs.stonybrook.edu/api-compat-study Chia-Che Tsai chitsai@cs.stonybrook.edu

Recommend


More recommend